From: Taylor R Campbell Date: Fri, 7 Dec 2018 16:57:01 +0000 (+0000) Subject: Oops, this broke polar notation. X-Git-Tag: mit-scheme-pucked-10.1.7~3^2~32 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=0bed12f3e8fec70cb3a1217f5cd7e3f9ed8e10d7;p=mit-scheme.git Oops, this broke polar notation. --- diff --git a/tests/runtime/test-numpar.scm b/tests/runtime/test-numpar.scm index 6aa557f27..1c18d2ac3 100644 --- a/tests/runtime/test-numpar.scm +++ b/tests/runtime/test-numpar.scm @@ -40,6 +40,15 @@ USA. (lambda () (assert-eqv-nan (string->number s) v)))))) +(define (define-relerr-test s v bound #!optional xfail) + (define-test s + (lambda () + (with-xfail xfail + (lambda () + (let ((u (string->number s))) + (assert-number u) + (assert-<= (magnitude (/ (- u v) v)) bound))))))) + (define (define-error-test s #!optional xfail) (define-test s (lambda () @@ -62,6 +71,9 @@ USA. (define assert-eqv-nan (simple-binary-assertion eqv-nan? #f)) +(define assert-number + (predicate-assertion number? "number")) + (define (with-xfail xfail body) (if (default-object? xfail) (body) @@ -166,6 +178,9 @@ USA. (define-eqv-test "2-0.i" (make-rectangular 2 -0.)) (define-eqv-test "-2-0.i" (make-rectangular -2 -0.)) +(define-eqv-test "1@0" 1 expect-failure) +(define-relerr-test "1@3.141592653589793" -1 1e-15 expect-failure) + (define-eqv-test "+nan.0" (flo:make-nan #f #t 0)) (define-eqv-test "-nan.0" (flo:make-nan #t #t 0)) (define-eqv-test "+nan.1" (flo:make-nan #f #t 1))