on master help sign in
A test showing that JRec is currently crazy
commit3652d9a643133872fd2a1e6369fed5c67b2091b1 authorArtyom Kazak <artyom@artyom.me> dateFri 4 Sep 2020, 00:29 (6 years ago) parent74bf248
1 file changed+8
test/JRecSpec.hs+8
test/JRecSpec.hs+8
@@ -5,8 +5,16 @@ import JRec
55import Test.Hspec
66import GHC.Stack
77
8+data Pair a = Pair !a !a
9+ deriving (Eq, Show)
10+
811spec :: HasCallStack => Spec
912spec = do
13+ it "is not crazy" $ do
14+ Pair (Rec (#a := 1)) (Rec (#a := 2))
15+ `shouldNotBe` Pair (Rec (#a := 1)) (Rec (#a := 1))
16+ Pair (Rec (#a := 1)) (Rec (#a := 2))
17+ `shouldNotBe` Pair (Rec (#a := 2)) (Rec (#a := 2))
1018 it "polymorphic" $ do
1119 (Rec (#u := True, #a := 5, #b := 6, #a := 2 ) & #u .~ 5)
1220 `shouldBe` Rec (#u := 5, #a := 5, #b := 6, #a := 2)