@@ -7,8 +7,8 @@ import Test.Hspec
7spec :: Spec
7spec :: Spec
9 it "polymorphic" $ do
9 it "polymorphic" $ do
10− (Rec (#u := True, #a := 5, #a := 2, #b := 6) & #u .~ 5)
10+ (Rec (#u := True, #a := 5, #b := 6, #a := 2 ) & #u .~ 5)
11− `shouldBe` Rec (#u := 5, #a := 5, #a := 2, #b := 6)
11+ `shouldBe` Rec (#u := 5, #a := 5, #b := 6, #a := 2)
12 it "show" $ do
12 it "show" $ do
13 show (Rec ()) `shouldBe` "{}"
13 show (Rec ()) `shouldBe` "{}"
14 show (Rec (#foo := True)) `shouldBe` "{foo = True}"
14 show (Rec (#foo := True)) `shouldBe` "{foo = True}"
@@ -58,6 +58,12 @@ spec = do
58 r2 = Rec (#c := 7, #a := 8)
58 r2 = Rec (#c := 7, #a := 8)
59 r1 `union` r2
59 r1 `union` r2
60 `shouldBe` Rec (#b := 5, #a := 6, #c := 7)
60 `shouldBe` Rec (#b := 5, #a := 6, #c := 7)
61+ describe "insert" $ do
62+ it "simple insert" $ do
63+ (#a := 1) `insert` Rec (#b := 2, #c := 3)
64+ `shouldBe` Rec (#a := 1, #b := 2, #c := 3)
65+ it "duplicate insert should be disallowed" $ do
61-- describe "insertOrSet" $ do
67-- describe "insertOrSet" $ do
62-- it "distinct" $ do
68-- it "distinct" $ do
63-- insertOrSet (#a := 1) (Rec (#b := 2, #c := 3))
69-- insertOrSet (#a := 1) (Rec (#b := 2, #c := 3))