mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-12 23:47:34 +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)
|
(define (test-equal? expect res)
|
||||||
(or (equal? expect res)
|
(or (equal? expect res)
|
||||||
(and (number? expect)
|
(if (real? expect)
|
||||||
(inexact? expect)
|
(and (inexact? expect)
|
||||||
(approx-equal? expect res (current-test-epsilon)))))
|
(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)}.
|
;;> Begin testing a new group until the closing @scheme{(test-end)}.
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
current-test-epsilon current-test-comparator)
|
current-test-epsilon current-test-comparator)
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme write)
|
(scheme write)
|
||||||
|
(scheme complex)
|
||||||
(scheme process-context)
|
(scheme process-context)
|
||||||
(scheme time)
|
(scheme time)
|
||||||
(only (srfi 1) every))
|
(only (srfi 1) every))
|
||||||
|
|
Loading…
Add table
Reference in a new issue