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

Commit f231853

Browse files
committed
Summarize with the number of lines.
1 parent e986ed0 commit f231853

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/Data/Source/Spec.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ testTree = Tasty.testGroup "Data.Source"
7070
]
7171

7272
]
73-
where summarize src
74-
| nullSource src = "empty"
75-
| otherwise = "non-empty"
73+
where summarize src = case sourceLines src of
74+
[] -> "empty"
75+
[x] -> if nullSource x then "empty" else "single-line"
76+
_ -> "multiple lines"
7677

7778
spec :: Spec
7879
spec = do

0 commit comments

Comments
 (0)