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:
parent
698497b1a0
commit
3beda88f32
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user