From: fennecdjay Date: Sat, 13 Jul 2019 16:14:05 +0000 (+0200) Subject: :wrench: Work on tests X-Git-Tag: nightly~2340 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ff0b6b42c341dcf3b8c246cbc2c217f0b759cfa3;p=gwion.git :wrench: Work on tests --- diff --git a/tests/nonnull/nonnull_at_nonnull.gw b/tests/nonnull/nonnull_at_nonnull.gw new file mode 100644 index 00000000..5dd55161 --- /dev/null +++ b/tests/nonnull/nonnull_at_nonnull.gw @@ -0,0 +1 @@ +new Object! @=> Object !o; diff --git a/tests/nonnull/nonnull_decl.gw b/tests/nonnull/nonnull_decl.gw new file mode 100644 index 00000000..e32f1aa7 --- /dev/null +++ b/tests/nonnull/nonnull_decl.gw @@ -0,0 +1 @@ +Object !o; diff --git a/tests/nonnull/nonnull_decl_ref.gw b/tests/nonnull/nonnull_decl_ref.gw new file mode 100644 index 00000000..a0dff383 --- /dev/null +++ b/tests/nonnull/nonnull_decl_ref.gw @@ -0,0 +1,2 @@ +#! [contains] NullPtrException +Object ! @ o; diff --git a/tests/nonnull/nonnull_decl_ref_assign.gw b/tests/nonnull/nonnull_decl_ref_assign.gw new file mode 100644 index 00000000..34c99852 --- /dev/null +++ b/tests/nonnull/nonnull_decl_ref_assign.gw @@ -0,0 +1 @@ +new Object @=> Object ! @ o; diff --git a/tests/nonnull/nonnull_impl_nonnull.gw b/tests/nonnull/nonnull_impl_nonnull.gw new file mode 100644 index 00000000..c8566b97 --- /dev/null +++ b/tests/nonnull/nonnull_impl_nonnull.gw @@ -0,0 +1,2 @@ +fun void test(Object !o) { <<< o >>>; } +Object !o => test; diff --git a/tests/nonnull/normal_at_nonnull.gw b/tests/nonnull/normal_at_nonnull.gw new file mode 100644 index 00000000..72d689a2 --- /dev/null +++ b/tests/nonnull/normal_at_nonnull.gw @@ -0,0 +1 @@ +new Object @=> Object !o; diff --git a/tests/nonnull/normal_cast_nonnull.gw b/tests/nonnull/normal_cast_nonnull.gw new file mode 100644 index 00000000..da1bbc75 --- /dev/null +++ b/tests/nonnull/normal_cast_nonnull.gw @@ -0,0 +1,2 @@ +#! [contains] can't cast +new Object $ Object!; diff --git a/tests/nonnull/normal_impl_nonnull.gw b/tests/nonnull/normal_impl_nonnull.gw new file mode 100644 index 00000000..2e16439b --- /dev/null +++ b/tests/nonnull/normal_impl_nonnull.gw @@ -0,0 +1,2 @@ +fun void test(Object !o) { <<< o >>>; } +new Object => test; diff --git a/tests/nonnull/null_at_nonnull.gw b/tests/nonnull/null_at_nonnull.gw new file mode 100644 index 00000000..3fd7de70 --- /dev/null +++ b/tests/nonnull/null_at_nonnull.gw @@ -0,0 +1,2 @@ +#! [contains] can't assign +null @=> Object !o; diff --git a/tests/nonnull/null_cast_nonnull.gw b/tests/nonnull/null_cast_nonnull.gw new file mode 100644 index 00000000..8f66ffdc --- /dev/null +++ b/tests/nonnull/null_cast_nonnull.gw @@ -0,0 +1,2 @@ +#! [contains] can't cast +null $ Object!; diff --git a/tests/nonnull/null_impl_nonnull.gw b/tests/nonnull/null_impl_nonnull.gw new file mode 100644 index 00000000..b9628cde --- /dev/null +++ b/tests/nonnull/null_impl_nonnull.gw @@ -0,0 +1,3 @@ +#! [contains] NullPtrException +fun void test(Object !o) { <<< o >>>; } +null => test; diff --git a/tests/nonnull/ref_at_nonnull.gw b/tests/nonnull/ref_at_nonnull.gw new file mode 100644 index 00000000..55f5c447 --- /dev/null +++ b/tests/nonnull/ref_at_nonnull.gw @@ -0,0 +1,2 @@ +#! [contains] NullPtrException +Object @o @=> Object !o; diff --git a/tests/nonnull/ref_cast_nonnull.gw b/tests/nonnull/ref_cast_nonnull.gw new file mode 100644 index 00000000..35cc4984 --- /dev/null +++ b/tests/nonnull/ref_cast_nonnull.gw @@ -0,0 +1,2 @@ +#! [contains] NullPtrException +(Object @ o) $ Object!; diff --git a/tests/nonnull/ref_impl_nonnull.gw b/tests/nonnull/ref_impl_nonnull.gw new file mode 100644 index 00000000..ea07c0b4 --- /dev/null +++ b/tests/nonnull/ref_impl_nonnull.gw @@ -0,0 +1,3 @@ +#! [contains] can't implicitly cast +fun void test(Object !o) { <<< o >>>; } +Object @o => test; diff --git a/tests/sh/opt.sh b/tests/sh/opt.sh index 128437f8..8234e3d1 100644 --- a/tests/sh/opt.sh +++ b/tests/sh/opt.sh @@ -8,16 +8,8 @@ source tests/sh/common.sh run "$n" "test arguments" "examples/shred.gw:12" "file" n=$((n+1)) -good="All heap blocks were freed -- no leaks are possible" N=$(printf "% 4i" "$n") -valgrind ./gwion -d silent &> "file" -ok=0 -grep "$good" "file" > /dev/null && ok=1 -if [ $ok ] -then echo "ok $N test driver" -else echo "not ok $N test driver" -fi -rm "file" +run "$n" "simple run" "" "file" # help n=$((n+1))