1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Move the label call into summarize.

Co-Authored-By: Patrick Thomson <patrickt@users.noreply.github.com>
This commit is contained in:
Rob Rix 2019-08-06 16:23:35 -04:00
parent 698497b1a0
commit 3beda88f32
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -26,11 +26,11 @@ testTree :: Tasty.TestTree
testTree = Tasty.testGroup "Data.Source"
[ Tasty.testGroup "sourceLineRanges"
[ prop "produces 1 more range than there are newlines" $ \ source -> do
label (summarize source)
summarize source
length (sourceLineRanges source) === length (Text.splitOn "\r\n" (toText source) >>= Text.splitOn "\r" >>= Text.splitOn "\n")
, prop "produces exhaustive ranges" $ \ source -> do
label (summarize source)
summarize source
foldMap (`slice` source) (sourceLineRanges source) === source
]
@ -70,7 +70,7 @@ testTree = Tasty.testGroup "Data.Source"
]
]
where summarize src = case sourceLines src of
where summarize src = label $ case sourceLines src of
[] -> "empty"
[x] -> if nullSource x then "empty" else "single-line"
_ -> "multiple lines"