diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-03-31 19:54:47 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-03-31 19:54:47 -0700 |
| commit | e8056e48ccc2e90c373fbd6c9a1fb2b39578df18 (patch) | |
| tree | 1b00d666d6fdd1d9a26b6fc9b0c01fca66592ad1 /csc/testing.csc | |
| parent | 07221d401de8d633cc58fec8c313617b0716ef1d (diff) | |
| download | chromatopelma-e8056e48ccc2e90c373fbd6c9a1fb2b39578df18.tar.zst | |
Allow overriding the cmp function in assert-equal.
Diffstat (limited to 'csc/testing.csc')
| -rw-r--r-- | csc/testing.csc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/csc/testing.csc b/csc/testing.csc index a0180e6..aad2a63 100644 --- a/csc/testing.csc +++ b/csc/testing.csc @@ -59,11 +59,13 @@ (define-syntax assert-equal (syntax-rules () + ((assert-equal cmp left right) + (let ((x left) + (y right)) + (unless (cmp x y) + (fatalf "Fatal: {} is not equal to {}.\nleft is {}\nright is {}" 'left 'right x y)))) ((assert-equal left right) - (let ((x left) - (y right)) - (unless (equal? x y) - (fatalf "Fatal: {} is not equal to {}.\nleft is {}\nright is {}" 'left 'right x y)))))) + (assert-equal equal? left right)))) (define-syntax assert-raises |
