]> Nishi Git Mirror - gwion.git/commitdiff
:white_check_mark: Yet more tests.
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 7 Jul 2019 21:21:53 +0000 (23:21 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 7 Jul 2019 21:21:53 +0000 (23:21 +0200)
Makefile
examples/typeof.gw
examples/typeof_decl.gw [new file with mode: 0644]
tests/error/invalid_global_class.gw [new file with mode: 0644]
tests/error/invalid_global_file.gw [new file with mode: 0644]
tests/sh/opt.sh

index a75dc806b37b5a4b99acaa9fbc276845495ed949..aecc7843534e16fdc96e3f5c412bebbc84cb2723 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ emit_src := $(wildcard src/emit/*.c)
 opt_src := $(wildcard opt/*.c)
 
 test_dir := $(filter-out tests/benchmark, $(wildcard tests/*))
-
+test_dir += examples
 # add boolean
 ifeq (${DEBUG_STACK}, 1)
 CFLAGS += -DDEBUG_STACK
index 997321f54ea888834f5807f23074295a795f1904..cf4d51950faf253fb83aa77dc65dc1d2f70013b1 100644 (file)
@@ -1,18 +1 @@
-class C {
-  static int i;
-  float f;
-}
-
-int i;
-typeof(i) a;
-<<< a >>>;
-
-typeof(C.i) b;
-<<< b >>>;
-
-C c;
-typeof(c.f) d;
-<<< d >>>;
-
-<<< i," ", c >>>;
+<<<typeof(1)>>>;
diff --git a/examples/typeof_decl.gw b/examples/typeof_decl.gw
new file mode 100644 (file)
index 0000000..a712564
--- /dev/null
@@ -0,0 +1,2 @@
+int i;
+<<<`i` j>>>;
diff --git a/tests/error/invalid_global_class.gw b/tests/error/invalid_global_class.gw
new file mode 100644 (file)
index 0000000..a20ed9c
--- /dev/null
@@ -0,0 +1,6 @@
+#! [contains] 'global' can only be used at class scope
+class C {
+  {
+    global int i;
+  }
+}
diff --git a/tests/error/invalid_global_file.gw b/tests/error/invalid_global_file.gw
new file mode 100644 (file)
index 0000000..c8eeaa3
--- /dev/null
@@ -0,0 +1,4 @@
+#! [contains] 'global' can only be used at file scope
+{
+global int i;
+}
index e9f845b6db67b38470d7db4fdcc2394c302068f9..0bffa9934b2f8a208849cbf5af980a3dd014c66f 100644 (file)
@@ -65,11 +65,11 @@ run "$n" "loop" "-l0" "file"
 
 # memoization
 n=$((n+1))
-run "$n" "memoize" "-z2 xamples/*.gw" "file"
+run "$n" "memoize" "-z2 tests/new/pure/.gw" "file"
 
 # (fake) module arg
 n=$((n+1))
-run "$n" "memoize" "-mfake:test" "file"
+run "$n" "module argument" "-mfake:test" "file"
 
 # get Kompile time Konfig
 n=$((n+1))