From c3e19280e15b90de9e31a17049a27c57c73d357b Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Tue, 20 Nov 2018 08:48:55 +0000 Subject: [PATCH] magnitude is busted when both components are infinite. --- tests/runtime/test-arith.scm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index 24332b01c..4e0fa8b5c 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -739,4 +739,28 @@ USA. (exp (flo:nextafter flo:greatest-normal-exponent-base-e (flo:+inf.0)))) (assert-inf+ (expt 10. - (flo:nextafter flo:greatest-normal-exponent-base-2 (flo:+inf.0)))))) \ No newline at end of file + (flo:nextafter flo:greatest-normal-exponent-base-2 (flo:+inf.0)))))) + +(define-enumerated-test 'infinite-magnitude + (vector + +inf.0 + -inf.0 + +inf.0+i + +inf.0-i + -inf.0-i + -inf.0+i + 1+inf.0i + 1-inf.0i + -1-inf.0i + -1+inf.0i + +inf.0+inf.0i + +inf.0-inf.0i + -inf.0-inf.0i + -inf.0+inf.0i) + (lambda (z) + (with-expected-failure + (and (infinite? (real-part z)) + (infinite? (imag-part z)) + 'xfail) + (lambda () + (assert-inf+ (magnitude z)))))) \ No newline at end of file -- 2.25.1