diff --git a/lib/chibi/test.scm b/lib/chibi/test.scm index 6322fde2..50ee849f 100644 --- a/lib/chibi/test.scm +++ b/lib/chibi/test.scm @@ -632,9 +632,13 @@ (define (test-equal? expect res) (or (equal? expect res) - (and (number? expect) - (inexact? expect) - (approx-equal? expect res (current-test-epsilon))))) + (if (real? expect) + (and (inexact? expect) + (real? res) + (approx-equal? expect res (current-test-epsilon))) + (and (complex? res) + (test-equal? (real-part expect) (real-part res)) + (test-equal? (imag-part expect) (imag-part res)))))) ;;> Begin testing a new group until the closing @scheme{(test-end)}. diff --git a/lib/chibi/test.sld b/lib/chibi/test.sld index 2073911e..e72bffc4 100644 --- a/lib/chibi/test.sld +++ b/lib/chibi/test.sld @@ -11,6 +11,7 @@ current-test-epsilon current-test-comparator) (import (scheme base) (scheme write) + (scheme complex) (scheme process-context) (scheme time) (only (srfi 1) every))