aboutsummaryrefslogtreecommitdiffstats
path: root/csc/testing.csc
diff options
context:
space:
mode:
Diffstat (limited to 'csc/testing.csc')
-rw-r--r--csc/testing.csc12
1 files changed, 7 insertions, 5 deletions
diff --git a/csc/testing.csc b/csc/testing.csc
index ecf5547..e46d300 100644
--- a/csc/testing.csc
+++ b/csc/testing.csc
@@ -6,6 +6,7 @@
test
test-main)
(import (scheme base)
+ (only (csc compare) diff)
(only (csc format)
printf
sprintf))
@@ -59,11 +60,12 @@
(define-syntax assert-equal
(syntax-rules ()
- ((assert-equal cmp left right)
- (let ((x left)
- (y right))
- (unless (cmp x y)
- (fatalf "Fatal:\n {}\nis not equal to\n {}.\nleft is\n {}\nright is\n {}" 'left 'right x y))))
+ ((assert-equal left right transformers ...)
+ (let* ((x left)
+ (y right)
+ (d (diff x y transformers ...)))
+ (unless (string=? "" d)
+ (fatalf "Fatal:\n {}\nis not equal to\n {}.\nleft is\n {}\nright is\n {}\ndiff (-left +right):\n{}" 'left 'right x y d))))
((assert-equal left right)
(assert-equal equal? left right))))