From 646f75a875f0f560b1090abfad0078cc03301263 Mon Sep 17 00:00:00 2001 From: Lyon Date: Fri, 4 Aug 2023 17:23:30 +0800 Subject: [PATCH] eventloop passed --- package/PikaStdLib/PikaStdData_Dict.c | 8 +++----- port/linux/.vscode/launch.json | 3 +-- .../pikascript-lib/PikaStdLib/PikaStdData_Dict.c | 8 +++----- port/linux/test/py-test.cpp | 6 ++++++ src/PikaVersion.h | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/package/PikaStdLib/PikaStdData_Dict.c b/package/PikaStdLib/PikaStdData_Dict.c index 9132c1c28..e0f84758b 100644 --- a/package/PikaStdLib/PikaStdData_Dict.c +++ b/package/PikaStdLib/PikaStdData_Dict.c @@ -222,11 +222,9 @@ Arg* PikaStdData_dict_items___next__(PikaObj* self) { if (NULL == key) { return arg_newNone(); } - PikaObj* tuple = newNormalObj(New_PikaStdData_Tuple); - PikaStdData_Tuple___init__(tuple); - PikaList* list = obj_getPtr(tuple, "list"); - pikaList_append(list, arg_copy(key)); - pikaList_append(list, arg_copy(val)); + PikaObj* tuple = New_pikaTuple(); + pikaList_append(tuple, arg_copy(key)); + pikaList_append(tuple, arg_copy(val)); args_setInt(self->list, "__iter_i", __iter_i + 1); return arg_newObj(tuple); } diff --git a/port/linux/.vscode/launch.json b/port/linux/.vscode/launch.json index 9ad9db1e0..163e3442f 100644 --- a/port/linux/.vscode/launch.json +++ b/port/linux/.vscode/launch.json @@ -11,8 +11,7 @@ "program": "${workspaceFolder}/build/test/pikascript_test", // "program": "${workspaceFolder}/build/boot/demo06-pikamain/pikascript_demo06-pikamain", "args": [ - // "--gtest_filter=json.loads" - "--gtest_filter=re.findall" + "--gtest_filter=eventloop.test1" ], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/port/linux/package/pikascript/pikascript-lib/PikaStdLib/PikaStdData_Dict.c b/port/linux/package/pikascript/pikascript-lib/PikaStdLib/PikaStdData_Dict.c index 9132c1c28..e0f84758b 100644 --- a/port/linux/package/pikascript/pikascript-lib/PikaStdLib/PikaStdData_Dict.c +++ b/port/linux/package/pikascript/pikascript-lib/PikaStdLib/PikaStdData_Dict.c @@ -222,11 +222,9 @@ Arg* PikaStdData_dict_items___next__(PikaObj* self) { if (NULL == key) { return arg_newNone(); } - PikaObj* tuple = newNormalObj(New_PikaStdData_Tuple); - PikaStdData_Tuple___init__(tuple); - PikaList* list = obj_getPtr(tuple, "list"); - pikaList_append(list, arg_copy(key)); - pikaList_append(list, arg_copy(val)); + PikaObj* tuple = New_pikaTuple(); + pikaList_append(tuple, arg_copy(key)); + pikaList_append(tuple, arg_copy(val)); args_setInt(self->list, "__iter_i", __iter_i + 1); return arg_newObj(tuple); } diff --git a/port/linux/test/py-test.cpp b/port/linux/test/py-test.cpp index af77fb511..1216da678 100644 --- a/port/linux/test/py-test.cpp +++ b/port/linux/test/py-test.cpp @@ -1,14 +1,20 @@ #include "test_common.h" TEST_START +// #define _SKIP_EVENTLOOP_TEST + #if !PIKA_NANO_ENABLE TEST_RUN_SINGLE_FILE(thread, test2, "test/python/_thread/test2.py") + +#ifndef _SKIP_EVENTLOOP_TEST TEST_RUN_SINGLE_FILE(eventloop, test1, "test/python/eventloop/test1.py") TEST_RUN_SINGLE_FILE(eventloop, test2, "test/python/eventloop/test2.py") TEST_RUN_SINGLE_FILE(eventloop, test3, "test/python/eventloop/test3.py") TEST_RUN_SINGLE_FILE(eventloop, delay1, "test/python/eventloop/delay1.py") TEST_RUN_SINGLE_FILE(eventloop, once1, "test/python/eventloop/once1.py") TEST_RUN_SINGLE_FILE(eventloop, once2, "test/python/eventloop/once2.py") +#endif + TEST_RUN_SINGLE_FILE(fsm, test1, "test/python/fsm/test1.py") TEST_RUN_SINGLE_FILE_PASS(builtin, diff --git a/src/PikaVersion.h b/src/PikaVersion.h index 999fe036f..f0277a525 100644 --- a/src/PikaVersion.h +++ b/src/PikaVersion.h @@ -2,4 +2,4 @@ #define PIKA_VERSION_MINOR 12 #define PIKA_VERSION_MICRO 4 -#define PIKA_EDIT_TIME "2023/08/04 17:15:04" +#define PIKA_EDIT_TIME "2023/08/04 17:23:14"