test/test_datafile.rb in avro-1.9.2 vs test/test_datafile.rb in avro-1.10.0

- old
+ new

@@ -178,9 +178,22 @@ reader.each {|record| records << record } end assert_equal records, ['a' * 10_000] end + def test_zstandard + Avro::DataFile.open('data.avr', 'w', '"string"', :zstandard) do |writer| + writer << 'a' * 10_000 + end + assert(File.size('data.avr') < 600) + + records = [] + Avro::DataFile.open('data.avr') do |reader| + reader.each {|record| records << record } + end + assert_equal records, ['a' * 10_000] + end + def test_append_to_deflated_file schema = Avro::Schema.parse('"string"') writer = Avro::IO::DatumWriter.new(schema) file = Avro::DataFile::Writer.new(File.open('data.avr', 'wb'), writer, schema, :deflate) file << 'a' * 10_000