From ece9ff7af5daa46728e1de9781fcd60b8416b48e Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 8 Oct 2019 13:49:37 +0200 Subject: [PATCH] :white_check_mark: More tests --- tests/error/func_alternative_void.gw | 3 +++ tests/error/missing_return_value.gw | 2 ++ tests/error/template_not_able.gw | 3 +++ tests/error/varloop_only.gw | 5 +++++ tests/internal_op/cast_similar.gw | 3 +++ tests/internal_op/implicit_similar.gw | 3 +++ tests/tree/typedef_auto_loop.gw | 3 +++ 7 files changed, 22 insertions(+) create mode 100644 tests/error/func_alternative_void.gw create mode 100644 tests/error/missing_return_value.gw create mode 100644 tests/error/template_not_able.gw create mode 100644 tests/error/varloop_only.gw create mode 100644 tests/internal_op/cast_similar.gw create mode 100644 tests/internal_op/implicit_similar.gw create mode 100644 tests/tree/typedef_auto_loop.gw diff --git a/tests/error/func_alternative_void.gw b/tests/error/func_alternative_void.gw new file mode 100644 index 00000000..3047f4b3 --- /dev/null +++ b/tests/error/func_alternative_void.gw @@ -0,0 +1,3 @@ +#! [contains] void +fun void test(int i) {} +() => test; diff --git a/tests/error/missing_return_value.gw b/tests/error/missing_return_value.gw new file mode 100644 index 00000000..d1ce8cb8 --- /dev/null +++ b/tests/error/missing_return_value.gw @@ -0,0 +1,2 @@ +#! [contains] missing value for return +fun int test() { return; } diff --git a/tests/error/template_not_able.gw b/tests/error/template_not_able.gw new file mode 100644 index 00000000..2b804442 --- /dev/null +++ b/tests/error/template_not_able.gw @@ -0,0 +1,3 @@ +#! [contains] not able to guess types for template call +fun void test<~A,B~>(A a) {} +test(1); diff --git a/tests/error/varloop_only.gw b/tests/error/varloop_only.gw new file mode 100644 index 00000000..551f2318 --- /dev/null +++ b/tests/error/varloop_only.gw @@ -0,0 +1,5 @@ +#! [contains] Varloop must be the only expression +fun void test(...) { + <<<"test">>>, vararg.start; + vararg.end; +} diff --git a/tests/internal_op/cast_similar.gw b/tests/internal_op/cast_similar.gw new file mode 100644 index 00000000..19d4a1fd --- /dev/null +++ b/tests/internal_op/cast_similar.gw @@ -0,0 +1,3 @@ +typedef int INT; +INT i; +<<< i $ int >>>; diff --git a/tests/internal_op/implicit_similar.gw b/tests/internal_op/implicit_similar.gw new file mode 100644 index 00000000..1775c26b --- /dev/null +++ b/tests/internal_op/implicit_similar.gw @@ -0,0 +1,3 @@ +typedef int INT; +fun void test(INT i) { <<< i >>>; } +1 => test; diff --git a/tests/tree/typedef_auto_loop.gw b/tests/tree/typedef_auto_loop.gw new file mode 100644 index 00000000..cadca626 --- /dev/null +++ b/tests/tree/typedef_auto_loop.gw @@ -0,0 +1,3 @@ +typedef int[2] Type; +Type type; +for(auto a : type); -- 2.43.0