about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2023-10-14 00:55:57 +0100
committerArun Isaac2023-10-14 00:55:57 +0100
commit3063c33634d4a25ba99a2c884dd8bf04e519f914 (patch)
treef2fc1822a0ade7cc6fb7d38fe25c1ec7d46eff88 /tests
parenta310aa43c3907fae62156be5478a3dacbb4e92f8 (diff)
downloadccwl-3063c33634d4a25ba99a2c884dd8bf04e519f914.tar.gz
ccwl-3063c33634d4a25ba99a2c884dd8bf04e519f914.tar.lz
ccwl-3063c33634d4a25ba99a2c884dd8bf04e519f914.zip
ccwl: Detect multiple expressions in workflow body.
* ccwl/ccwl.scm (workflow): Detect multiple expressions in workflow
body and raise an exception.
* tests/ccwl.scm ("unrecognized workflow syntaxes must raise a
&ccwl-violation condition"): Test for the formatted message too.
("multiple expressions in workflow body must raise a &ccwl-violation
condition"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/ccwl.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/ccwl.scm b/tests/ccwl.scm
index cd78739..76bcecd 100644
--- a/tests/ccwl.scm
+++ b/tests/ccwl.scm
@@ -177,7 +177,19 @@
 
 (test-assert "unrecognized workflow syntaxes must raise a &ccwl-violation condition"
   (guard (exception
-          (else (ccwl-violation? exception)))
+          (else (and (ccwl-violation? exception)
+                     (string=? (formatted-message-format exception)
+                               "Unrecognized workflow syntax [expected (workflow (input ...) tree)]"))))
+    (begin (macroexpand
+            '(workflow foo ((message #:type string))
+                       (print #:message message)))
+           #f)))
+
+(test-assert "multiple expressions in workflow body must raise a &ccwl-violation condition"
+  (guard (exception
+          (else (and (ccwl-violation? exception)
+                     (string=? (formatted-message-format exception)
+                               "More than one expression ~a in workflow body. Perhaps you need to combine them with a pipe or a tee?"))))
     (begin (macroexpand
             '(workflow ((message1 #:type string)
                         (message2 #:type string))