aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2023-10-09 14:56:17 +0100
committerArun Isaac2023-10-09 20:32:39 +0100
commitde18ef6d55b52f52837395684e6b8265b2ad26b3 (patch)
tree379206c34a321b4f50fa21fef40d9ab4cff5bb90 /tests
parent7dbe776cb56803d9c66a847f5ac3613366754838 (diff)
downloadccwl-de18ef6d55b52f52837395684e6b8265b2ad26b3.tar.gz
ccwl-de18ef6d55b52f52837395684e6b8265b2ad26b3.tar.lz
ccwl-de18ef6d55b52f52837395684e6b8265b2ad26b3.zip
tests: Catch expressions that don't raise exceptions.
Many tests that use guard to catch and ensure that certain conditions are raised actually leak and let through cases where the expressions result in a truthy value. * tests/ccwl.scm ("input, when passed more than one positional argument, must raise a &ccwl-violation condition", "input, when passed an unrecognized keyword, must raise a &ccwl-violation condition", "input, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition", "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", "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"): Catch expressions that don't raise exceptions.
Diffstat (limited to 'tests')
-rw-r--r--tests/ccwl.scm49
1 files changed, 29 insertions, 20 deletions
diff --git a/tests/ccwl.scm b/tests/ccwl.scm
index 4f10450..219e3f7 100644
--- a/tests/ccwl.scm
+++ b/tests/ccwl.scm
@@ -58,58 +58,67 @@
(test-assert "input, when passed more than one positional argument, must raise a &ccwl-violation condition"
(guard (exception
(else (ccwl-violation? exception)))
- (input #'(message string))))
+ (begin (input #'(message string))
+ #f)))
(test-assert "input, when passed an unrecognized keyword, must raise a &ccwl-violation condition"
(guard (exception
(else (ccwl-violation? exception)))
- (input #'(message #:foo string))))
+ (begin (input #'(message #:foo string))
+ #f)))
(test-assert "input, when passed multiple arguments to a unary keyword, must raise a &ccwl-violation condition"
(guard (exception
(else (ccwl-violation? exception)))
- (input #'(message #:type int string))))
+ (begin (input #'(message #:type int string))
+ #f)))
(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))))
+ (begin (output #'(message string))
+ #f)))
(test-assert "output, when passed an unrecognized keyword, must raise a &ccwl-violation condition"
(guard (exception
(else (ccwl-violation? exception)))
- (output #'(message #:foo string))))
+ (begin (output #'(message #:foo string))
+ #f)))
(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))))
+ (begin (output #'(message #:type int string))
+ #f)))
(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)))))
+ (begin (macroexpand
+ '(command foo
+ #:inputs (message #:type string)
+ #:run "echo" message
+ #:outputs (stdout #:type stdout)))
+ #f)))
(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)))))
+ (begin (macroexpand
+ '(command #:foo (message #:type string)
+ #:run "echo" message
+ #:outputs (stdout #:type stdout)))
+ #f)))
(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"))))
+ (begin (macroexpand
+ '(command #:inputs (message #:type string)
+ #:run "echo" message
+ #:outputs (stdout #:type stdout)
+ #:stdin "foo" "bar"))
+ #f)))
;; TODO: Define this in the lexical scope of the test that requires
;; it.