summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2023-11-06 11:01:43 +0000
committerArun Isaac2023-11-06 11:01:43 +0000
commit31d0328abebcae98b21b57cecfc255ec6442e157 (patch)
tree02adff614c5c72781a660f482f3df48a0de63656 /tests
parent69ceaa5268810b099140aa14a68a36e7fc5a5106 (diff)
downloadccwl-31d0328abebcae98b21b57cecfc255ec6442e157.tar.gz
ccwl-31d0328abebcae98b21b57cecfc255ec6442e157.tar.lz
ccwl-31d0328abebcae98b21b57cecfc255ec6442e157.zip
ccwl: Error out if #:other parameters are not serializable to YAML.
* ccwl/ccwl.scm (ensure-yaml-serializable): New function.
(input, output, command): Use ensure-yaml-serializable.
* tests/ccwl.scm ("inputs with #:other parameters that fail to
evaluate must raise a &ccwl-violation condition", "outputs with
#:other parameters that fail to evaluate must raise a &ccwl-violation
condition", "commands with #:other parameters that fail to evaluate
must raise a &ccwl-violation condition"): New tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/ccwl.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/ccwl.scm b/tests/ccwl.scm
index d8100c5..117f93f 100644
--- a/tests/ccwl.scm
+++ b/tests/ccwl.scm
@@ -285,4 +285,36 @@
                       #:run "cat" file))
            #f)))
 
+(test-assert "inputs with #:other parameters that fail to evaluate must raise a &ccwl-violation condition"
+  (guard (exception
+          (else (and (ccwl-violation? exception)
+                     (string=? (formatted-message-format exception)
+                               "#:other parameter not serializable to YAML"))))
+    (begin (macroexpand
+            '(command #:inputs (file #:type File
+                                     #:other '((secondaryFiles . ".fai")))
+                      #:run "cat" file))
+           #f)))
+
+(test-assert "outputs with #:other parameters that fail to evaluate must raise a &ccwl-violation condition"
+  (guard (exception
+          (else (and (ccwl-violation? exception)
+                     (string=? (formatted-message-format exception)
+                               "#:other parameter not serializable to YAML"))))
+    (begin (macroexpand
+            '(command #:outputs (file #:type File
+                                      #:other '((secondaryFiles . ".fai")))
+                      #:run "cat" file))
+           #f)))
+
+(test-assert "commands with #:other parameters that fail to evaluate must raise a &ccwl-violation condition"
+  (guard (exception
+          (else (and (ccwl-violation? exception)
+                     (string=? (formatted-message-format exception)
+                               "#:other parameter not serializable to YAML"))))
+    (begin (macroexpand
+            '(command #:run "cat" file
+                      #:other '((secondaryFiles . ".fai"))))
+           #f)))
+
 (test-end "ccwl")