def test_listbuilder_null_ptrs(self):
schema = """
@0xbf5147cbbecf40c1;
struct Bar {
x @0 :Int64;
y @1 :Int64;
name @2 :Text;
}
struct Foo {
bars @0 :List(Bar);
}
"""
mod = self.compile(schema)
a = mod.Bar(1, 2, None)
b = mod.Bar(3, 4, None)
foo = mod.Foo([a, b])
a1 = foo.bars[0]
assert a1.x == 1
assert a1.y == 2
assert a1.name is None
评论列表
文章目录