test_misc.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:capnpy 作者: antocuni 项目源码 文件源码
def test_listbuilder_bug(self):
        schema = """
            @0xbf5147cbbecf40c1;
            struct Bar {
                x @0 :Int64;
                y @1 :Int64;
            }

            struct Foo {
                name @0 :Text;
                bars @1 :List(Bar);
            }
        """
        mod = self.compile(schema)
        bars = [mod.Bar(1, 2)]
        foo = mod.Foo(b'name', bars)
        assert len(foo.bars) == 1
        assert foo.bars[0].x == 1
        assert foo.bars[0].y == 2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号