Skip to content

Commit 1fe4bc7

Browse files
committed
Fix inequality test to actually test /=
1 parent 06f72c2 commit 1fe4bc7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/Tests.purs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@ import Test.QuickCheck
77
import Test.QuickCheck.Functions
88
import Test.QuickCheck.Classes
99

10+
type Ty = Maybe Number
11+
1012
main = do
1113

1214
let ty = Just 0
1315

1416
trace "test equality"
1517
check1 $ \n -> Just n == Just n
16-
assert $ Nothing == Nothing :: Maybe Number
18+
assert $ Nothing == Nothing :: Ty
1719

1820
trace "test inequality"
19-
check1 $ \n -> not $ Just n == Nothing
20-
check1 $ \n -> not $ Nothing == Just n
21-
check1 $ \n -> not $ Just n == Just (n + 1)
21+
check1 $ \n -> Just n /= Nothing
22+
check1 $ \n -> Nothing /= Just n
23+
check1 $ \n -> Just n /= Just (n + 1)
2224

2325
trace "test order"
2426
check2 $ \x y -> compare (Just x) (Just y) == compare x y
2527
check1 $ \x -> compare Nothing (Just x) == LT
2628
check1 $ \x -> compare (Just x) Nothing == GT
27-
check1 $ \x -> compare Nothing (Nothing :: Maybe Number) == EQ
29+
check1 $ \x -> compare Nothing (Nothing :: Ty) == EQ
2830

2931
trace "maybe should transform a value wrapped in a Just"
3032
check1 $ \n -> maybe 0 negate (Just n) == -n

0 commit comments

Comments
 (0)