mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-12 15:37:35 +02:00
Fixing test handling of inexact complex numbers.
This commit is contained in:
parent
d893c89838
commit
da4909907f
2 changed files with 8 additions and 3 deletions
|
@ -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)}.
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue