1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Test that derived & generic equality agree.

This commit is contained in:
Rob Rix 2017-11-30 10:38:46 -05:00
parent a76ca3fcfc
commit 221a88f452

View File

@ -8,6 +8,17 @@ import Test.Hspec.LeanCheck
spec :: Spec
spec = parallel $ do
describe "Eq1" $ do
describe "genericLiftEq" $ do
prop "equivalent to derived (==) for product types" $
\ a b -> genericLiftEq (==) a b `shouldBe` a == (b :: Product Int)
prop "equivalent to derived (==) for sum types" $
\ a b -> genericLiftEq (==) a b `shouldBe` a == (b :: Sum Int)
prop "equivalent to derived (==) for recursive types" $
\ a b -> genericLiftEq (==) a b `shouldBe` a == (b :: Tree Int)
describe "Ord1" $ do
describe "genericLiftCompare" $ do
prop "equivalent to derived compare for product types" $