summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2022-01-16 12:50:38 +0530
committerArun Isaac2022-01-16 13:17:36 +0530
commitfbb0e6f9c2fe9321045708c1c9eab91627ad241e (patch)
tree06b1e4978eb59be59cd544d83736a2ebd6651196 /tests
parentb3f18dbf95d80d92a708f04be53b8d98b7980a80 (diff)
downloadccwl-fbb0e6f9c2fe9321045708c1c9eab91627ad241e.tar.gz
ccwl-fbb0e6f9c2fe9321045708c1c9eab91627ad241e.tar.lz
ccwl-fbb0e6f9c2fe9321045708c1c9eab91627ad241e.zip
ccwl: Raise exceptions on output syntax errors.
* ccwl/ccwl.scm (output): Raise &ccwl-violation conditions on syntax errors. * tests/ccwl.scm (output): New function. ("output, when passed more than one positional argument, must raise a &ccwl-violation condition", "output, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "output, 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.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ccwl.scm b/tests/ccwl.scm
index bc9fb01..d667b32 100644
--- a/tests/ccwl.scm
+++ b/tests/ccwl.scm
@@ -24,6 +24,9 @@
(define input
(@@ (ccwl ccwl) input))
+(define output
+ (@@ (ccwl ccwl) output))
+
(test-begin "ccwl")
(test-assert "stdin input should not have inputBinding"
@@ -67,4 +70,19 @@
(else (ccwl-violation? exception)))
(input #'(message #:type int string))))
+(test-assert "output, when passed more than one positional argument, must raise a &ccwl-violation condition"
+ (guard (exception
+ (else (ccwl-violation? exception)))
+ (output #'(message string))))
+
+(test-assert "output, when passed an unrecognized keyword, must raise a &ccwl-violation condition"
+ (guard (exception
+ (else (ccwl-violation? exception)))
+ (output #'(message #:foo string))))
+
+(test-assert "output, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"
+ (guard (exception
+ (else (ccwl-violation? exception)))
+ (output #'(message #:type int string))))
+
(test-end "ccwl")