mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
e7e501ab73
* Merge branch 'master' into tuple * sue SyntaxItemList * cut the parser * update preCompiler * not use tiny_obj in stdlib * use BUILTIN_STRUCT_ENABLE for list, dict, tuple * add PikaStdData.Tuple() * !51 Support bind .pyi from other *.py expect main.py * fix overflow issue * fix overflow issue and simplification code * update PikaCV_Image.c.
38 lines
993 B
C
38 lines
993 B
C
#include "test_common.h"
|
|
|
|
#if PIKA_SYNTAX_SLICE_ENABLE
|
|
TEST(builtin, bytes) {
|
|
/* init */
|
|
pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "../../examples/BuiltIn/bytes.py");
|
|
/* collect */
|
|
uint8_t* res = obj_getBytes(pikaMain, "res");
|
|
/* assert */
|
|
EXPECT_EQ(res[1], 1);
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
#endif
|
|
|
|
#if PIKA_BUILTIN_STRUCT_ENABLE
|
|
TEST(builtin, type1) {
|
|
/* init */
|
|
pikaMemInfo.heapUsedMax = 0;
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
/* run */
|
|
__platform_printf("BEGIN\r\n");
|
|
pikaVM_runSingleFile(pikaMain, "../../examples/BuiltIn/type.py");
|
|
/* collect */
|
|
/* assert */
|
|
EXPECT_STREQ(log_buff[1], "BEGIN\r\n");
|
|
EXPECT_STREQ(log_buff[0], "OK\r\n");
|
|
/* deinit */
|
|
obj_deinit(pikaMain);
|
|
EXPECT_EQ(pikaMemNow(), 0);
|
|
}
|
|
#endif
|