mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
23 lines
612 B
C
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 |