mirror of
https://github.com/github/semantic.git
synced 2024-11-28 18:23:44 +03:00
Test that openTerm returns Just for open terms.
This commit is contained in:
parent
41e03beb85
commit
1f6440e7a1
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user