]> Nishi Git Mirror - gwion.git/commitdiff
:wrench: Work on tests
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sat, 13 Jul 2019 16:14:05 +0000 (18:14 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sat, 13 Jul 2019 16:14:05 +0000 (18:14 +0200)
15 files changed:
tests/nonnull/nonnull_at_nonnull.gw [new file with mode: 0644]
tests/nonnull/nonnull_decl.gw [new file with mode: 0644]
tests/nonnull/nonnull_decl_ref.gw [new file with mode: 0644]
tests/nonnull/nonnull_decl_ref_assign.gw [new file with mode: 0644]
tests/nonnull/nonnull_impl_nonnull.gw [new file with mode: 0644]
tests/nonnull/normal_at_nonnull.gw [new file with mode: 0644]
tests/nonnull/normal_cast_nonnull.gw [new file with mode: 0644]
tests/nonnull/normal_impl_nonnull.gw [new file with mode: 0644]
tests/nonnull/null_at_nonnull.gw [new file with mode: 0644]
tests/nonnull/null_cast_nonnull.gw [new file with mode: 0644]
tests/nonnull/null_impl_nonnull.gw [new file with mode: 0644]
tests/nonnull/ref_at_nonnull.gw [new file with mode: 0644]
tests/nonnull/ref_cast_nonnull.gw [new file with mode: 0644]
tests/nonnull/ref_impl_nonnull.gw [new file with mode: 0644]
tests/sh/opt.sh

diff --git a/tests/nonnull/nonnull_at_nonnull.gw b/tests/nonnull/nonnull_at_nonnull.gw
new file mode 100644 (file)
index 0000000..5dd5516
--- /dev/null
@@ -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 (file)
index 0000000..e32f1aa
--- /dev/null
@@ -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 (file)
index 0000000..a0dff38
--- /dev/null
@@ -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 (file)
index 0000000..34c9985
--- /dev/null
@@ -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 (file)
index 0000000..c8566b9
--- /dev/null
@@ -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 (file)
index 0000000..72d689a
--- /dev/null
@@ -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 (file)
index 0000000..da1bbc7
--- /dev/null
@@ -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 (file)
index 0000000..2e16439
--- /dev/null
@@ -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 (file)
index 0000000..3fd7de7
--- /dev/null
@@ -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 (file)
index 0000000..8f66ffd
--- /dev/null
@@ -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 (file)
index 0000000..b9628cd
--- /dev/null
@@ -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 (file)
index 0000000..55f5c44
--- /dev/null
@@ -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 (file)
index 0000000..35cc498
--- /dev/null
@@ -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 (file)
index 0000000..ea07c0b
--- /dev/null
@@ -0,0 +1,3 @@
+#! [contains] can't implicitly cast
+fun void test(Object !o) { <<< o >>>; }
+Object @o => test;
index 128437f858aa082c49c877c4d4fc6f704da503d8..8234e3d1606a035fea3733fefea214730d206402 100644 (file)
@@ -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))