mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
add test
This commit is contained in:
parent
5a2696f4db
commit
43f11f26b6
@ -2,8 +2,12 @@ class Test:
|
||||
a = 1
|
||||
b = 'test'
|
||||
def __init__(self):
|
||||
a = 2
|
||||
b = 'pewq'
|
||||
self.a = 2
|
||||
self.b = 'pewq'
|
||||
|
||||
print(Test.a)
|
||||
print(Test.b)
|
||||
|
||||
test = Test()
|
||||
print(test.a)
|
||||
print(test.b)
|
||||
|
@ -23,9 +23,11 @@ TEST(class, classpar1) {
|
||||
__platform_printf("BEGIN\r\n");
|
||||
pikaVM_runSingleFile(self, "../../examples/Class/classpar1.py");
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "test\r\n");
|
||||
EXPECT_STREQ(log_buff[1], "1\r\n");
|
||||
EXPECT_STREQ(log_buff[2], "BEGIN\r\n");
|
||||
EXPECT_STREQ(log_buff[4], "BEGIN\r\n");
|
||||
EXPECT_STREQ(log_buff[3], "1\r\n");
|
||||
EXPECT_STREQ(log_buff[2], "test\r\n");
|
||||
EXPECT_STREQ(log_buff[1], "2\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "pewq\r\n");
|
||||
/* deinit */
|
||||
obj_deinit(self);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user