def test_struct(self):
schema = """
@0xbf5147cbbecf40c1;
struct Point {
x @0 :Int64;
y @1 :Int64;
}
struct Rectangle {
a @0 :Point;
b @1 :Point;
empty @2 :Point;
}
"""
self.mod = self.compile(schema)
p1 = self.mod.Point(1, 2)
p2 = self.mod.Point(3, 4)
r = self.mod.Rectangle(p1, p2, None)
self.check(r, '(a = (x = 1, y = 2), b = (x = 3, y = 4))')
评论列表
文章目录