Skip to content

Remove NaN tests for Ord and Eq #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions test/Test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -53,15 +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 "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
testOrd 'a' 'b' LT
Expand Down