adding test-not

This commit is contained in:
Alex Shinn 2011-02-24 23:28:36 +09:00
parent d7c6275b07
commit 000c69e904
2 changed files with 6 additions and 1 deletions

View file

@ -1,7 +1,7 @@
(define-module (chibi test) (define-module (chibi test)
(export (export
test test-error test-assert test-values test test-error test-assert test-not test-values
test-group current-test-group test-group current-test-group
test-begin test-end test-syntax-error test-info test-begin test-end test-syntax-error test-info
test-vars test-run ;;test-exit test-vars test-run ;;test-exit

View file

@ -80,6 +80,11 @@
(test-syntax-error 'test-assert "1 or 2 arguments required" (test-syntax-error 'test-assert "1 or 2 arguments required"
(test a ...))))) (test a ...)))))
(define-syntax test-not
(syntax-rules ()
((_ expr) (test-assert (not expr)))
((_ name expr) (test-assert name (not expr)))))
(define-syntax test-values (define-syntax test-values
(syntax-rules () (syntax-rules ()
((_ expect expr) ((_ expect expr)