Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 0af81b1

Browse files
robrixpatrickt
andcommitted
Label using classify.
Co-Authored-By: Patrick Thomson <patrickt@users.noreply.github.com>
1 parent 3beda88 commit 0af81b1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/Data/Source/Spec.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Test.Hspec
99

1010
import qualified Generators as Gen
1111
import qualified Hedgehog.Gen as Gen
12-
import Hedgehog ((===), label)
12+
import Hedgehog ((===))
1313
import qualified Hedgehog.Range
1414
import Hedgehog hiding (Range)
1515
import qualified Test.Tasty as Tasty
@@ -70,10 +70,11 @@ testTree = Tasty.testGroup "Data.Source"
7070
]
7171

7272
]
73-
where summarize src = label $ case sourceLines src of
74-
[] -> "empty"
75-
[x] -> if nullSource x then "empty" else "single-line"
76-
_ -> "multiple lines"
73+
where summarize src = do
74+
let lines = sourceLines src
75+
classify "empty" $ nullSource src
76+
classify "single-line" $ length lines == 1
77+
classify "multiple lines" $ length lines > 1
7778

7879
spec :: Spec
7980
spec = do

0 commit comments

Comments
 (0)