summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-10-09 06:22:05 +0100
committerjao <jao@gnu.org>2022-10-09 06:50:10 +0100
commita70c47c557e17f26803aa2be3836745b36fed1a2 (patch)
treead803bd1d20884e629e45f745d2a5077dd521cde
parent501fa22da461a0d739cfb977daa6bf0c163b7dd4 (diff)
downloadgeiser-chez-a70c47c557e17f26803aa2be3836745b36fed1a2.tar.gz
geiser-chez-a70c47c557e17f26803aa2be3836745b36fed1a2.tar.bz2
unit test fixes
-rw-r--r--src/geiser/test.ss31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/geiser/test.ss b/src/geiser/test.ss
index 2407448..023f4b0 100644
--- a/src/geiser/test.ss
+++ b/src/geiser/test.ss
@@ -4,8 +4,7 @@
(define-syntax assert-equal
(syntax-rules ()
((_ a b)
- (if (equal? a b)
- #t
+ (or (equal? a b)
(begin
(display (format "failed assertion `~a' == `~a'" a b))
(assert (equal? a b)))))))
@@ -19,41 +18,29 @@
(define-syntax do-test
(syntax-rules ()
- ((_ form result)
- (assert
- (equal?
- (get-result form)
- result)))))
+ ((_ form result) (assert-equal (get-result form) result))))
(define-syntax do-test-macroexpand
(syntax-rules ()
- ((_ form result)
- (assert
- (equal? (geiser:macroexpand form)
- result)))))
+ ((_ form result) (assert-equal (geiser:macroexpand form) result))))
(define-syntax test-or
(syntax-rules ()
((_ x) x)
((_ x xs ...)
- (if x
- x
- (test-or xs ...)))))
+ (if x x (test-or xs ...)))))
-(do-test-macroexpand
- '(test-or 1)
- '1)
+(do-test-macroexpand '(test-or 1) "1\n")
-(do-test-macroexpand
- '(test-or 1 2)
- '(if 1 1 2))
+(do-test-macroexpand '(test-or 1 2) "(if 1 1 2)\n")
;; (something-doesnot-exist)
;;=> Error: Exception: variable something-doesnot-exist is not bound
(do-test
'(something-doesnot-exist)
- "((result \"\") (output . \"\") (error (key . \"Exception: variable something-doesnot-exist is not bound\")))\n"
- )
+ (string-append "((result \"\") (output . \"\") (error (key . condition) (msg . "
+ "\"Exception: variable something-doesnot-exist is not bound\")))"
+ "\n"))
;; (make-violation)
;;=> #<condition &violation>