aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-09-30 15:10:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-09-30 15:30:55 +0200
commit16e74b781e0fafeed0312c9fa0fd1ae03cf432ea (patch)
tree606224d576d36b8c081c19122a9b7c63ee6a68a2 /tests
parent15000dc770e864112aa83035a371117b9ca6e991 (diff)
Allow attributes in if-else, assert directive's conditions
Diffstat (limited to 'tests')
-rw-r--r--tests/directive/assert.testscript6
-rw-r--r--tests/if-else/buildfile5
-rw-r--r--tests/if-else/testscript18
3 files changed, 29 insertions, 0 deletions
diff --git a/tests/directive/assert.testscript b/tests/directive/assert.testscript
index e3774cf..a050051 100644
--- a/tests/directive/assert.testscript
+++ b/tests/directive/assert.testscript
@@ -26,3 +26,9 @@ EOE
$* <'assert junk' 2>>EOE != 0
<stdin>:1:8: error: invalid bool value: 'junk'
EOE
+
+: null
+:
+$* <'assert [null]' 2>>EOE != 0
+<stdin>:1:8: error: invalid bool value: null
+EOE
diff --git a/tests/if-else/buildfile b/tests/if-else/buildfile
new file mode 100644
index 0000000..9c791a4
--- /dev/null
+++ b/tests/if-else/buildfile
@@ -0,0 +1,5 @@
+# file : tests/if-else/buildfile
+# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+./: testscript $b
diff --git a/tests/if-else/testscript b/tests/if-else/testscript
new file mode 100644
index 0000000..afc0302
--- /dev/null
+++ b/tests/if-else/testscript
@@ -0,0 +1,18 @@
+# file : tests/if-else/testscript
+# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Test if-else.
+
+# @@ TODO: more test from old-tests/
+
+.include ../common.testscript
+
+: null
+:
+$* <<EOI 2>>EOE != 0
+if [null]
+ print t
+EOI
+<stdin>:1:4: error: invalid bool value: null
+EOE