fix c binding test

This commit is contained in:
blueloveTH 2023-09-28 22:10:22 +08:00
parent e1b2bda6aa
commit a810973f65
2 changed files with 2 additions and 8 deletions

View File

@ -123,7 +123,7 @@ int main(int argc, char** argv) {
PRINT_TITLE("test basic exec"); PRINT_TITLE("test basic exec");
check(pkpy_exec(vm, "print('hello world!')")); check(pkpy_exec(vm, "print('hello world!')"));
error(pkpy_getglobal(vm, pkpy_name("nonexistatn"))); fail(pkpy_getglobal(vm, pkpy_name("nonexistatn")));
// test int methods // test int methods
PRINT_TITLE("test int methods"); PRINT_TITLE("test int methods");
@ -367,7 +367,7 @@ int main(int argc, char** argv) {
PRINT_TITLE("test other errors"); PRINT_TITLE("test other errors");
check(pkpy_getglobal(vm, pkpy_name("test_error_propagate"))); check(pkpy_getglobal(vm, pkpy_name("test_error_propagate")));
check(pkpy_pop_top(vm)); check(pkpy_pop_top(vm));
error(pkpy_getglobal(vm, pkpy_name("nonexistant"))); fail(pkpy_getglobal(vm, pkpy_name("nonexistant")));
error(pkpy_exec(vm, "raise NameError('testing error throwing from python')")); error(pkpy_exec(vm, "raise NameError('testing error throwing from python')"));
PRINT_TITLE("test TypeError"); PRINT_TITLE("test TypeError");

View File

@ -1,9 +1,6 @@
====== test basic exec ====== ====== test basic exec ======
hello world! hello world!
successfully errored with this message:
Traceback (most recent call last):
NameError: nonexistatn
====== test int methods ====== ====== test int methods ======
11 11
@ -79,9 +76,6 @@ NameError: catch me
====== test other errors ====== ====== test other errors ======
successfully errored with this message: successfully errored with this message:
Traceback (most recent call last):
NameError: nonexistant
successfully errored with this message:
Traceback (most recent call last): Traceback (most recent call last):
File "main.py", line 1 File "main.py", line 1
raise NameError('testing error throwing from python') raise NameError('testing error throwing from python')