From 2bddb7a95462f81d8f336a586c8cea40f94b4628 Mon Sep 17 00:00:00 2001 From: Antti Holvikari Date: Thu, 8 May 2025 18:05:35 +0300 Subject: [PATCH 1/2] Remove NaN tests for Ord Fixes #306 --- test/Test/Main.purs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index fd763cf0..fa6876c0 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -57,10 +57,6 @@ testOrderings = do testOrd nan 1.0 GT testOrd nan plusInfinity GT testOrd plusInfinity nan GT - assert "1 > NaN should be false" $ (1.0 > nan) == false - assert "1 < NaN should be false" $ (1.0 < nan) == false - assert "NaN > 1 should be false" $ (nan > 1.0) == false - assert "NaN < 1 should be false" $ (nan < 1.0) == false assert "NaN == 1 should be false" $ nan /= 1.0 testOrd (1 / 0) 0 EQ testOrd (mod 1 0) 0 EQ From 232a8c5a330a853a45d4ee335e949d247ea34854 Mon Sep 17 00:00:00 2001 From: Antti Holvikari Date: Sat, 10 May 2025 20:25:53 +0300 Subject: [PATCH 2/2] Remove all Ord/Eq tests for NaN --- test/Test/Main.purs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index fa6876c0..ef15756d 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -32,9 +32,6 @@ testOrd x y ord = ("(compare " <> show x <> " " <> show y <> " ) is not equal to " <> show ord) $ (compare x y) == ord -nan :: Number -nan = 0.0/0.0 - plusInfinity :: Number plusInfinity = 1.0/0.0 @@ -43,8 +40,6 @@ minusInfinity = -1.0/0.0 testOrderings :: AlmostEff testOrderings = do - assert "NaN shouldn't be equal to itself" $ nan /= nan - assert "NaN shouldn't be equal to itself" $ (compare nan nan) /= EQ testOrd 1.0 2.0 LT testOrd 2.0 1.0 GT testOrd 1.0 (-2.0) GT @@ -53,11 +48,6 @@ testOrderings = do testOrd minusInfinity 0.0 LT testOrd plusInfinity 0.0 GT testOrd plusInfinity minusInfinity GT - testOrd 1.0 nan GT - testOrd nan 1.0 GT - testOrd nan plusInfinity GT - testOrd plusInfinity nan GT - assert "NaN == 1 should be false" $ nan /= 1.0 testOrd (1 / 0) 0 EQ testOrd (mod 1 0) 0 EQ testOrd 'a' 'b' LT