1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Test that openTerm returns Just for open terms.

This commit is contained in:
Rob Rix 2015-12-21 20:08:05 -05:00
parent 41e03beb85
commit 1f6440e7a1

View File

@ -177,6 +177,9 @@ spec = do
] `shouldBe` Nothing
describe "openTerm" $ do
it "returns Just the term if its substring does not end with a newline" $
let term = Info (Range 0 2) mempty :< Leaf "" in openTerm " " term `shouldBe` Just term
it "returns Nothing for terms whose substring ends with a newline" $
openTerm " \n" (Info (Range 0 2) mempty :< Leaf "") `shouldBe` Nothing