diff options
author | Arun Isaac | 2023-10-14 00:30:04 +0100 |
---|---|---|
committer | Arun Isaac | 2023-10-14 00:30:04 +0100 |
commit | a310aa43c3907fae62156be5478a3dacbb4e92f8 (patch) | |
tree | ffd7055df63a4ceafe91b9d39d7ca4e8b01e5551 | |
parent | 8465cbf1923e6e8e7dde682eb06875970762b649 (diff) | |
download | ccwl-a310aa43c3907fae62156be5478a3dacbb4e92f8.tar.gz ccwl-a310aa43c3907fae62156be5478a3dacbb4e92f8.tar.lz ccwl-a310aa43c3907fae62156be5478a3dacbb4e92f8.zip |
ccwl: Raise &ccwl-violation when workflow syntax is not recognized.
* ccwl/ccwl.scm (workflow): Raise &ccwl-violation when workflow syntax
is not recognized.
* tests/ccwl.scm ("unrecognized workflow syntaxes must raise a
&ccwl-violation condition"): New test.
-rw-r--r-- | ccwl/ccwl.scm | 6 | ||||
-rw-r--r-- | tests/ccwl.scm | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index 5a6aaed..d9d9c78 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -615,5 +615,7 @@ a <key> object, in STEPS, a list of <step> objects. If no such (list #,@(filter-map (cut key->output <> steps) output-keys)) '()))) - (x (error "Unrecognized workflow syntax [expected (workflow (input ...) tree)]:" - (syntax->datum #'x)))))) + (x + (raise-exception + (condition (ccwl-violation #'x) + (formatted-message "Unrecognized workflow syntax [expected (workflow (input ...) tree)]"))))))) diff --git a/tests/ccwl.scm b/tests/ccwl.scm index e64713c..cd78739 100644 --- a/tests/ccwl.scm +++ b/tests/ccwl.scm @@ -175,4 +175,14 @@ (print #:message mess))) #f))) +(test-assert "unrecognized workflow syntaxes must raise a &ccwl-violation condition" + (guard (exception + (else (ccwl-violation? exception))) + (begin (macroexpand + '(workflow ((message1 #:type string) + (message2 #:type string)) + (print (print1) #:message message1) + (print (print2) #:message message2))) + #f))) + (test-end "ccwl") |