From: fennecdjay Date: Sun, 7 Jul 2019 21:21:53 +0000 (+0200) Subject: :white_check_mark: Yet more tests. X-Git-Tag: nightly~2348^2~26 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=4d026ea5ac2f1ded8689a2e1073df32657ac2eaa;p=gwion.git :white_check_mark: Yet more tests. --- diff --git a/Makefile b/Makefile index a75dc806..aecc7843 100644 --- 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 diff --git a/examples/typeof.gw b/examples/typeof.gw index 997321f5..cf4d5195 100644 --- a/examples/typeof.gw +++ b/examples/typeof.gw @@ -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 >>>; +<<>>; diff --git a/examples/typeof_decl.gw b/examples/typeof_decl.gw new file mode 100644 index 00000000..a7125644 --- /dev/null +++ b/examples/typeof_decl.gw @@ -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 index 00000000..a20ed9c0 --- /dev/null +++ b/tests/error/invalid_global_class.gw @@ -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 index 00000000..c8eeaa35 --- /dev/null +++ b/tests/error/invalid_global_file.gw @@ -0,0 +1,4 @@ +#! [contains] 'global' can only be used at file scope +{ +global int i; +} diff --git a/tests/sh/opt.sh b/tests/sh/opt.sh index e9f845b6..0bffa993 100644 --- a/tests/sh/opt.sh +++ b/tests/sh/opt.sh @@ -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))