diff options
-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") |