@@ -1,12 +1,11 @@
1−{-# OPTIONS_GHC -fdefer-type-errors #-}
21module JRecSpec (spec) where
32
43import Control.Lens ((&), (.~), (^.))
54import JRec
65import Test.Hspec
7−import Test.ShouldNotTypecheck
6+import GHC.Stack
87
9−spec :: Spec
8+spec :: HasCallStack => Spec
109spec = do
1110 it "polymorphic" $ do
1211 (Rec (#u := True, #a := 5, #b := 6, #a := 2 ) & #u .~ 5)
@@ -73,8 +72,6 @@ spec = do
7372 it "simple insert" $ do
7473 (#a := 1) `insert` Rec (#b := 2, #c := 3)
7574 `shouldBe` Rec (#a := 1, #b := 2, #c := 3)
76− it "type-check fails if field already exists" $ do
77− shouldNotTypecheck ((#a := '1') `insert` Rec (#b := '2', #a := '0'))
7875 describe "insertOrSet" $ do
7976 it "distinct" $ do
8077 insertOrSet (#a := 1) (Rec (#b := 2, #c := 3))