mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
Test openLineBy over openTerm.
This commit is contained in:
parent
60edd3b19a
commit
d1abf65cdd
@ -160,11 +160,22 @@ spec = do
|
||||
Line True [ Div (Just "delete") [ span "/*", Break ] ]
|
||||
] `shouldBe` (Just $ Line True [ Div (Just "delete") [ span "*/" ] ])
|
||||
|
||||
it "should produce the earliest non-empty line in a list, if open" $
|
||||
openLineBy (openTerm "\n ") [
|
||||
Line True [ Info (Range 1 2) mempty :< Leaf "" ],
|
||||
Line True [ Info (Range 0 1) mempty :< Leaf "" ]
|
||||
] `shouldBe` (Just $ Line True [ Info (Range 1 2) mempty :< Leaf "" ])
|
||||
|
||||
it "should return Nothing if the earliest non-empty line is closed" $
|
||||
openLineBy openElement [
|
||||
Line True [ Div (Just "delete") [ span " * Debugging", Break ] ]
|
||||
] `shouldBe` Nothing
|
||||
|
||||
it "should return Nothing if the earliest non-empty line is closed" $
|
||||
openLineBy (openTerm "\n") [
|
||||
Line True [ Info (Range 0 1) mempty :< Leaf "" ]
|
||||
] `shouldBe` Nothing
|
||||
|
||||
where
|
||||
rightRowText text = rightRow [ Text text ]
|
||||
rightRow xs = Row EmptyLine (Line False xs)
|
||||
|
Loading…
Reference in New Issue
Block a user