From 41a1465e6b8b05608b546a6a78e1240aeabc98c6 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sun, 25 Feb 2024 18:54:13 +0100 Subject: [PATCH] :white_check_mark: update tests --- tests/array/array_ref_error.gw | 2 ++ tests/array/array_void_error.gw | 2 ++ tests/error/return.gw | 2 ++ tests/fptr/class_ptr2.gw | 6 +++--- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 tests/array/array_ref_error.gw create mode 100644 tests/array/array_void_error.gw create mode 100644 tests/error/return.gw diff --git a/tests/array/array_ref_error.gw b/tests/array/array_ref_error.gw new file mode 100644 index 00000000..9af67463 --- /dev/null +++ b/tests/array/array_ref_error.gw @@ -0,0 +1,2 @@ +#! [contains] ref types as array base +var Array:[&void][12] i; diff --git a/tests/array/array_void_error.gw b/tests/array/array_void_error.gw new file mode 100644 index 00000000..50263ff1 --- /dev/null +++ b/tests/array/array_void_error.gw @@ -0,0 +1,2 @@ +#! [contains] type of size 0 as array base +var void[12] i; diff --git a/tests/error/return.gw b/tests/error/return.gw new file mode 100644 index 00000000..24356044 --- /dev/null +++ b/tests/error/return.gw @@ -0,0 +1,2 @@ +#! [contains] 'return' statement found outside function definition +class C { return;} diff --git a/tests/fptr/class_ptr2.gw b/tests/fptr/class_ptr2.gw index 278cde07..032eb86d 100644 --- a/tests/fptr/class_ptr2.gw +++ b/tests/fptr/class_ptr2.gw @@ -1,10 +1,10 @@ class C { fun void test(int i) { <<< "int arg" >>>; } - funptr void PtrType(int i); + funptr void PtrType(int); test :=> var static PtrType p; - p(1); + p(this, 1); test :=> p; - p(1); + p(this,1); } var C c; -- 2.43.0