Fixing test handling of inexact complex numbers.

This commit is contained in:
Alex Shinn 2012-11-01 21:40:21 +09:00
parent d893c89838
commit da4909907f
2 changed files with 8 additions and 3 deletions

View file

@ -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)}.

View file

@ -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))