aboutsummaryrefslogtreecommitdiff
path: root/tests/directive
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-05-01 17:09:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-01 17:12:04 +0200
commit630b498533f5a9a1e9d40893f4806ef855f1e03b (patch)
tree18657642a3d0deffc1ed14ad449bd6f3ac4b1e64 /tests/directive
parentc7e9f97fc7684c01c692916be1ac2cfc92024a0c (diff)
Fix outstanding issue with directive vs assignment differentiation
Specifically, now the following does the right thing: print +foo
Diffstat (limited to 'tests/directive')
-rw-r--r--tests/directive/parsing.testscript23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/directive/parsing.testscript b/tests/directive/parsing.testscript
new file mode 100644
index 0000000..04dd054
--- /dev/null
+++ b/tests/directive/parsing.testscript
@@ -0,0 +1,23 @@
+# file : tests/directive/assert.testscript
+# license : MIT; see accompanying LICENSE file
+
+# Test overall directive parsing.
+#
+
+.include ../common.testscript
+
+: assign
+: Test differentiation with variable assignment.
+:
+{
+ # Note: ? is expanded as pattern.
+
+ $* <'print +foo' >'+foo' : plus
+ $* <'print ?foo' >'' : ques
+
+ $* <'print + foo' >'+ foo' : plus-ws-eq
+ $* <'print ? foo' >'foo' : ques-ws-eq
+
+ $* <'print +' >'+' : plus-only
+ $* <'print ?' >'' : ques-only
+}