interop/test_interop.rb in avro-1.9.2 vs interop/test_interop.rb in avro-1.10.0
- old
+ new
@@ -17,23 +17,25 @@
require 'rubygems'
require 'test/unit'
require 'avro'
-CODECS_TO_VALIDATE = ['deflate'] # The 'null' codec is implicitly included
+CODECS_TO_VALIDATE = ['deflate', 'snappy', 'zstandard'] # The 'null' codec is implicitly included
class TestInterop < Test::Unit::TestCase
HERE = File.expand_path(File.dirname(__FILE__))
SHARE = HERE + '/../../../share'
SCHEMAS = SHARE + '/test/schemas'
files = Dir[HERE + '/../../../build/interop/data/*.avro'].select do |fn|
- sep, codec = File.basename(fn, 'avro').rpartition('_')[1, 2]
+ sep, codec = File.basename(fn, '.avro').rpartition('_')[1, 2]
sep.empty? || CODECS_TO_VALIDATE.include?(codec)
end
+ puts "The following files will be tested:"
+ puts files
files.each do |fn|
- define_method("test_read_#{File.basename(fn, 'avro')}") do
+ define_method("test_read_#{File.basename(fn, '.avro')}") do
projection = Avro::Schema.parse(File.read(SCHEMAS+'/interop.avsc'))
File.open(fn) do |f|
r = Avro::DataFile::Reader.new(f, Avro::IO::DatumReader.new(projection))
i = 0