From da6995ae54b142993fb9c7d5fbb23f2a7c524bd8 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Dec 2015 12:48:04 -0500 Subject: [PATCH] Test that a single word string is covered by the returned range. --- test/Spec.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Spec.hs b/test/Spec.hs index e643310c9..22fc87af9 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -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)