diff options
-rw-r--r-- | ccwl/ccwl.scm | 6 | ||||
-rw-r--r-- | tests/ccwl.scm | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index b158947..286fd7a 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -535,6 +535,12 @@ represented by <step> objects." (pairify (syntax->datum #'(args ...))))))))) ;; ccwl functions with an implicit step identifier ((function args ...) + ;; Ensure that steps with expression commands have identifiers. + (unless (symbol? (syntax->datum #'function)) + (raise-exception + (condition (ccwl-violation #'function) + (formatted-message "Step with expression ~a that evaluates to a command must have identifier" + (syntax->datum #'function))))) (collect-steps #'(function (function) args ...) input-keys)) ;; any other unrecognized syntax diff --git a/tests/ccwl.scm b/tests/ccwl.scm index 2207200..4f10450 100644 --- a/tests/ccwl.scm +++ b/tests/ccwl.scm @@ -145,4 +145,13 @@ (print) #:message message))) +(test-assert "step with expression that evaluates to a command but without a step identifier must raise a &ccwl-violation condition" + (guard (exception + (else (ccwl-violation? exception))) + (begin (macroexpand + '(workflow ((message #:type string)) + ((and #t print) + #:message message))) + #f))) + (test-end "ccwl") |