This commit is contained in:
xushiwei
2024-05-12 11:11:19 +08:00
parent 64c13fa9ae
commit 0912f1f509
13 changed files with 140 additions and 41 deletions

View File

@@ -159,6 +159,11 @@ func TestCompileEx(t *testing.T, src any, fname, expected string) {
if err != nil {
t.Fatal("cl.NewPackage failed:", err)
}
if prog.NeedPyInit() { // call PyInit if needed
ret.PyInit()
}
if v := ret.String(); v != expected {
t.Fatalf("\n==> got:\n%s\n==> expected:\n%s\n", v, expected)
}