pikapython/test/closure-test.cpp
2023-02-22 19:26:37 +08:00

23 lines
612 B
C

#include "test_common.h"
TEST_START
#if !PIKA_NANO_ENABLE
TEST(closure, defdef){
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
pikaVM_runSingleFile(pikaMain, "test/python/closure/defdef.py");
obj_deinit(pikaMain);
EXPECT_STREQ(log_buff[0], "in test2\r\n");
EXPECT_EQ(pikaMemNow(), 0);
}
TEST(closure, defvardef){
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
pikaVM_runSingleFile(pikaMain, "test/python/closure/defvardef.py");
obj_deinit(pikaMain);
EXPECT_STREQ(log_buff[0], "in test2 var: 1\r\n");
EXPECT_EQ(pikaMemNow(), 0);
}
#endif
TEST_END