From a810973f6567c09909b75ce865ce5761599fe397 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 28 Sep 2023 22:10:22 +0800 Subject: [PATCH] fix c binding test --- c_bindings/test.c | 4 ++-- c_bindings/test_answers.txt | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/c_bindings/test.c b/c_bindings/test.c index 4b91d35e..94adb844 100644 --- a/c_bindings/test.c +++ b/c_bindings/test.c @@ -123,7 +123,7 @@ int main(int argc, char** argv) { PRINT_TITLE("test basic exec"); check(pkpy_exec(vm, "print('hello world!')")); - error(pkpy_getglobal(vm, pkpy_name("nonexistatn"))); + fail(pkpy_getglobal(vm, pkpy_name("nonexistatn"))); // test int methods PRINT_TITLE("test int methods"); @@ -367,7 +367,7 @@ int main(int argc, char** argv) { PRINT_TITLE("test other errors"); check(pkpy_getglobal(vm, pkpy_name("test_error_propagate"))); 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')")); PRINT_TITLE("test TypeError"); diff --git a/c_bindings/test_answers.txt b/c_bindings/test_answers.txt index ba9e11c9..8ab90613 100644 --- a/c_bindings/test_answers.txt +++ b/c_bindings/test_answers.txt @@ -1,9 +1,6 @@ ====== test basic exec ====== hello world! -successfully errored with this message: -Traceback (most recent call last): -NameError: nonexistatn ====== test int methods ====== 11 @@ -79,9 +76,6 @@ NameError: catch me ====== test other errors ====== successfully errored with this message: -Traceback (most recent call last): -NameError: nonexistant -successfully errored with this message: Traceback (most recent call last): File "main.py", line 1 raise NameError('testing error throwing from python')