]> Nishi Git Mirror - gwion.git/commitdiff
:white_check_mark: More tests
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 8 Oct 2019 11:49:37 +0000 (13:49 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 8 Oct 2019 11:49:37 +0000 (13:49 +0200)
tests/error/func_alternative_void.gw [new file with mode: 0644]
tests/error/missing_return_value.gw [new file with mode: 0644]
tests/error/template_not_able.gw [new file with mode: 0644]
tests/error/varloop_only.gw [new file with mode: 0644]
tests/internal_op/cast_similar.gw [new file with mode: 0644]
tests/internal_op/implicit_similar.gw [new file with mode: 0644]
tests/tree/typedef_auto_loop.gw [new file with mode: 0644]

diff --git a/tests/error/func_alternative_void.gw b/tests/error/func_alternative_void.gw
new file mode 100644 (file)
index 0000000..3047f4b
--- /dev/null
@@ -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 (file)
index 0000000..d1ce8cb
--- /dev/null
@@ -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 (file)
index 0000000..2b80444
--- /dev/null
@@ -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 (file)
index 0000000..551f231
--- /dev/null
@@ -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 (file)
index 0000000..19d4a1f
--- /dev/null
@@ -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 (file)
index 0000000..1775c26
--- /dev/null
@@ -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 (file)
index 0000000..cadca62
--- /dev/null
@@ -0,0 +1,3 @@
+typedef int[2] Type;
+Type type;
+for(auto a : type);