mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
add test for list inner dict
This commit is contained in:
parent
a31128f934
commit
1fb06d621a
@ -7,3 +7,6 @@ keys = d.keys()
|
||||
for k in keys:
|
||||
print(k)
|
||||
print(keys)
|
||||
|
||||
dd = {'list':[1,2,3], 'len':3}
|
||||
print(dd)
|
||||
|
@ -11,15 +11,16 @@ TEST(stddata, test1) {
|
||||
pikaVM_runSingleFile(pikaMain, "../../examples/BuiltIn/dict.py");
|
||||
/* collect */
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "dict_keys([c, b, a])\r\n");
|
||||
EXPECT_STREQ(log_buff[1], "a\r\n");
|
||||
EXPECT_STREQ(log_buff[2], "b\r\n");
|
||||
EXPECT_STREQ(log_buff[3], "c\r\n");
|
||||
EXPECT_STREQ(log_buff[4], "1\r\n");
|
||||
EXPECT_STREQ(log_buff[5], "2\r\n");
|
||||
EXPECT_STREQ(log_buff[6], "test\r\n");
|
||||
EXPECT_STREQ(log_buff[7], "{'c': test, 'b': 2, 'a': 1}\r\n");
|
||||
EXPECT_STREQ(log_buff[8], "BEGIN\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "{'len': 3, 'list': [1, 2, 3]}\r\n");
|
||||
EXPECT_STREQ(log_buff[1], "dict_keys([c, b, a])\r\n");
|
||||
EXPECT_STREQ(log_buff[2], "a\r\n");
|
||||
EXPECT_STREQ(log_buff[3], "b\r\n");
|
||||
EXPECT_STREQ(log_buff[4], "c\r\n");
|
||||
EXPECT_STREQ(log_buff[5], "1\r\n");
|
||||
EXPECT_STREQ(log_buff[6], "2\r\n");
|
||||
EXPECT_STREQ(log_buff[7], "test\r\n");
|
||||
EXPECT_STREQ(log_buff[8], "{'c': test, 'b': 2, 'a': 1}\r\n");
|
||||
EXPECT_STREQ(log_buff[9], "BEGIN\r\n");
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user