From 3caf3c6379496b12a5725fbe32282e6f2f130348 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 21 Nov 2023 14:29:30 +0000 Subject: ccwl: Report unknown keys passed to rename. * ccwl/ccwl.scm (collect-steps): Report unknown keys passed to rename. * tests/ccwl.scm ("rename with unknown key must raise a &ccwl-violation condition"): New test. --- ccwl/ccwl.scm | 3 ++- tests/ccwl.scm | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ccwl/ccwl.scm b/ccwl/ccwl.scm index a398947..cdae1c5 100644 --- a/ccwl/ccwl.scm +++ b/ccwl/ccwl.scm @@ -617,7 +617,8 @@ represented by objects." (raise-exception (condition (ccwl-violation new) (formatted-message "Expected keyword (for example: #:foo, #:bar)")))) - (unless (symbol? (syntax->datum old)) + (unless (memq (syntax->datum old) + (map key-name input-keys)) (raise-exception (condition (ccwl-violation old) (formatted-message "Unknown key ~a. Known keys at this step are ~a." diff --git a/tests/ccwl.scm b/tests/ccwl.scm index 9e09a16..e876912 100644 --- a/tests/ccwl.scm +++ b/tests/ccwl.scm @@ -301,4 +301,11 @@ '(workflow ((message #:type string)) (rename (foo) #:foo message)))) +(test-condition "rename with unknown key must raise a &ccwl-violation condition" + (ccwl-violation-with-message? + "Unknown key ~a. Known keys at this step are ~a.") + (macroexpand + '(workflow ((foo #:type string)) + (rename #:bar foobar)))) + (test-end "ccwl") -- cgit v1.2.3