mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
20 lines
509 B
C
20 lines
509 B
C
#include "test_common.h"
|
|
|
|
#if PIKA_SYNTEX_ITEM_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
|