1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 18:23:44 +03:00

Test the property that closed rows are closed.

This commit is contained in:
Rob Rix 2015-12-18 13:19:40 -05:00
parent c02bd6e11a
commit d699adc714

View File

@ -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 ] ]