# -*- coding: utf-8 -*- require 'helper' class TestRegressionAutofilter04 < Minitest::Test def setup setup_dir_var end def teardown @tempfile.close(true) end def test_autofilter04 @xlsx = 'autofilter04.xlsx' workbook = WriteXLSX.new(@io) worksheet = workbook.add_worksheet data = [] data_lines.split(/\n/).each { |line| data << line.split } worksheet.write('A1', headings) worksheet.autofilter('A1:D51') worksheet.filter_column('A', 'x eq East') worksheet.filter_column('C', 'x > 3000 and x < 8000') # Hide the rows that don't match the filter criteria. row = 1 data.each do |row_data| region = row_data[0] row_data[2] = row_data[2].to_i volume = row_data[2] if region == 'East' && volume > 3000 && volume < 8000 # Row is visible. else # Hide row. worksheet.set_row(row, nil, nil, 1) end worksheet.write(row, 0, row_data) row += 1 end workbook.close compare_for_regression( nil, {'xl/workbook.xml' => ['