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

Commit 698497b

Browse files
robrixpatrickt
andcommitted
Tidy up the sourceLineRanges tests using prop.
Co-Authored-By: Patrick Thomson <patrickt@users.noreply.github.com>
1 parent fc2233f commit 698497b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/Data/Source/Spec.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ prop desc f
2525
testTree :: Tasty.TestTree
2626
testTree = Tasty.testGroup "Data.Source"
2727
[ Tasty.testGroup "sourceLineRanges"
28-
[ testProperty "produces 1 more range than there are newlines" $ property $ do
29-
source <- forAll (Gen.source (Hedgehog.Range.linear 0 100))
28+
[ prop "produces 1 more range than there are newlines" $ \ source -> do
3029
label (summarize source)
31-
(length (sourceLineRanges source) === length (Text.splitOn "\r\n" (toText source) >>= Text.splitOn "\r" >>= Text.splitOn "\n"))
30+
length (sourceLineRanges source) === length (Text.splitOn "\r\n" (toText source) >>= Text.splitOn "\r" >>= Text.splitOn "\n")
3231

33-
, testProperty "produces exhaustive ranges" $ property $ do
34-
source <- forAll (Gen.source (Hedgehog.Range.linear 0 100))
32+
, prop "produces exhaustive ranges" $ \ source -> do
3533
label (summarize source)
3634
foldMap (`slice` source) (sourceLineRanges source) === source
3735
]

0 commit comments

Comments
 (0)