From d699adc7148958afc2b326c2543e6df8ad3509ae Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 18 Dec 2015 13:19:40 -0500 Subject: [PATCH] Test the property that closed rows are closed. --- test/SplitSpec.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/SplitSpec.hs b/test/SplitSpec.hs index fb22c3e35..7787c3fde 100644 --- a/test/SplitSpec.hs +++ b/test/SplitSpec.hs @@ -127,6 +127,10 @@ spec = do \ (a@(Row (Line ac1 as1) (Line bc1 bs1)), b@(Row (Line ac2 as2) (Line bc2 bs2))) -> adjoin2 [ a ] b `shouldBe` [ Row (Line (ac1 || ac2) $ as1 ++ as2) (Line (bc1 || bc2) $ bs1 ++ bs2) ] + prop "does not append onto closed rows" $ + forAll ((arbitrary `suchThat` isClosed) >>= \ a -> ((,) a) <$> (arbitrary `suchThat` isClosed)) $ + \ (a, b) -> adjoin2 [ a ] b `shouldBe` [ b, a ] + it "does not append elements onto complete lines" $ adjoin2 [ leftRow [ Break ] ] (leftRowText ",") `shouldBe` [ leftRowText ",", leftRow [ Break ] ]