diff options
author | Arun Isaac | 2022-01-16 13:01:25 +0530 |
---|---|---|
committer | Arun Isaac | 2022-01-16 13:17:36 +0530 |
commit | e12759ce31a746b0532fbb13371579f0aa19b518 (patch) | |
tree | 52f4c717d583533c13a73f82bffbe520378bba48 /tests | |
parent | fbb0e6f9c2fe9321045708c1c9eab91627ad241e (diff) | |
download | ccwl-e12759ce31a746b0532fbb13371579f0aa19b518.tar.gz ccwl-e12759ce31a746b0532fbb13371579f0aa19b518.tar.lz ccwl-e12759ce31a746b0532fbb13371579f0aa19b518.zip |
ccwl: Raise exceptions on command syntax errors.
* ccwl/ccwl.scm (command): Raise &ccwl-violation conditions on syntax
errors.
* tests/ccwl.scm ("command, when passed positional arguments, must
raise a &ccwl-violation condition", "command, when passed an
unrecognized keyword, must raise a &ccwl-violation condition",
"command, when passed multiple arguments to a unary keyword, must
raise a &ccwl-violation condition"): New tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ccwl.scm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ccwl.scm b/tests/ccwl.scm index d667b32..d99650e 100644 --- a/tests/ccwl.scm +++ b/tests/ccwl.scm @@ -85,4 +85,30 @@ (else (ccwl-violation? exception))) (output #'(message #:type int string)))) +(test-assert "command, when passed positional arguments, must raise a &ccwl-violation condition" + (guard (exception + (else (ccwl-violation? exception))) + (macroexpand + '(command foo + #:inputs (message #:type string) + #:run "echo" message + #:outputs (stdout #:type stdout))))) + +(test-assert "command, when passed an unrecognized keyword, must raise a &ccwl-violation condition" + (guard (exception + (else (ccwl-violation? exception))) + (macroexpand + '(command #:foo (message #:type string) + #:run "echo" message + #:outputs (stdout #:type stdout))))) + +(test-assert "command, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition" + (guard (exception + (else (ccwl-violation? exception))) + (macroexpand + '(command #:inputs (message #:type string) + #:run "echo" message + #:outputs (stdout #:type stdout) + #:stdin "foo" "bar")))) + (test-end "ccwl") |