11 @strings[i] = WrappedString.new("rubyrocks%i" % i)
16 @strings2 << WrappedString.new("rubyrocks%i" % i)
26 {"stringlist_a" => [@strings],
27 "stringlist_h" => [@strings2]}
31 class ListTest < Test::Unit::TestCase
33 data = ListTestData.new.to_eet
38 assert_nothing_raised do
39 stream = Eet::Stream.deserialize(data)
42 assert_equal(1, stream.length)
43 assert_equal("ListTest", stream.first.tag)
45 assert_nothing_raised do
46 stream = Eet::Stream.deserialize(stream.first.data)
49 assert_equal(10, stream.length)
51 ["stringlist_a", "stringlist_h"].each do |tag|
52 stringlist = stream.find_all { |c| c.tag == tag }
53 assert_equal(5, stringlist.length)
58 assert_nothing_raised do
59 d = stringlist.shift.data
60 str_stream = Eet::Stream.deserialize(d)
63 assert_equal(1, str_stream.length)
64 assert_equal("String", str_stream.first.tag)
68 assert_nothing_raised do
69 foo = Eet::Stream.deserialize(str_stream.first.data)
72 assert_equal(1, foo.length)
73 assert_equal("buf", foo.first.tag)
74 assert_equal("rubyrocks%i\0" % i, foo.first.data)
77 assert_equal([], stringlist)