From a68bbeac2302502574478a0f9069b879baf7706b Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sun, 25 Dec 2016 01:11:12 +0100 Subject: [PATCH] Check that the tests distinguish 0.0 and -0.0. --- testfuncs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testfuncs.py b/testfuncs.py index 8ebcab6..dd07d33 100644 --- a/testfuncs.py +++ b/testfuncs.py @@ -520,6 +520,11 @@ def do_tests(): test('reallyequal(NaN, -Indet, 0.0)', True) test('reallyequal(NaN, -(Infinity*0), 0.0)', True) test('reallyequal(Infinity*0, Indet, 0.0)', True) + # Check that it properly distinguishes -0.0 and 0.0 + test('reallyequal(-0.0, 0.0, 0.0)', False) + test('reallyequal(0.0, -0.0, 0.0)', False) + test('reallyequal(0.0, 0.0, 0.0)', True) + test('reallyequal(-0.0, -0.0, 0.0)', True) shouldexcept('div(1.0, 0.0)', ELSLMathError) shouldexcept('div(1, 0)', ELSLMathError)