From 221a88f4524725140b597737b822d72e23083047 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 30 Nov 2017 10:38:46 -0500 Subject: [PATCH] Test that derived & generic equality agree. --- test/Data/Functor/Classes/Generic/Spec.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/Data/Functor/Classes/Generic/Spec.hs b/test/Data/Functor/Classes/Generic/Spec.hs index f77133302..44c3c273c 100644 --- a/test/Data/Functor/Classes/Generic/Spec.hs +++ b/test/Data/Functor/Classes/Generic/Spec.hs @@ -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" $