1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Test that a single word string is covered by the returned range.

This commit is contained in:
Rob Rix 2015-12-14 12:48:04 -05:00
parent fca022109c
commit da6995ae54

View File

@ -136,6 +136,9 @@ main = hspec $ do
it "should produce no ranges for whitespace" $
rangesOfWordsFrom 0 " \t\n " `shouldBe` []
it "should produce a list containing the range of the string for a single-word string" $
rangesOfWordsFrom 0 "word" `shouldBe` [ Range 0 4 ]
where
rightRowText text = rightRow [ Text text ]
rightRow xs = Row EmptyLine (Line xs)