Skip to content

Commit a6dcef7

Browse files
committed
Split empty line comment tests
1 parent d1dbaef commit a6dcef7

File tree

1 file changed

+93
-64
lines changed

1 file changed

+93
-64
lines changed

tests/empty-comment.test

+93-64
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
---------------------------------------------------------------------
2-
RUN tests/empty-comment.hs
3-
FILE tests/empty-comment.hs
2+
RUN tests/empty-comment-single.hs
3+
FILE tests/empty-comment-single.hs
44

55
-- |
66
haddockAboveSingle = 1
77

88
haddockBelowSingle = 1
99
-- ^
1010

11+
OUTPUT
12+
tests/empty-comment-single.hs:2:1-4: Suggestion: Empty single-line haddock
13+
Found:
14+
-- |
15+
Perhaps you should remove it.
16+
17+
tests/empty-comment-single.hs:6:1-4: Suggestion: Empty single-line haddock
18+
Found:
19+
-- ^
20+
Perhaps you should remove it.
21+
22+
2 hints
23+
24+
---------------------------------------------------------------------
25+
RUN tests/empty-comment-singles.hs
26+
FILE tests/empty-comment-singles.hs
27+
1128
-- |
1229
--
1330
haddockAboveSingles = 1
@@ -16,17 +33,23 @@ haddockAboveSingles = 1
1633
-- >>>
1734
haddockAboveDoctest = 1
1835

19-
-- |
20-
--
21-
--
22-
-- foo
23-
haddockAboveIntoNonEmpty = 1
36+
OUTPUT
37+
tests/empty-comment-singles.hs:2:1-4: Suggestion: Empty single-line haddock
38+
Found:
39+
-- |
40+
Perhaps you should remove it.
2441

25-
haddockBelowIntoNonEmpty = 1
26-
-- ^
27-
--
28-
--
29-
-- foo
42+
tests/empty-comment-singles.hs:3:1-2: Suggestion: Empty single-line comment
43+
Found:
44+
--
45+
Perhaps you should remove it.
46+
47+
2 hints
48+
49+
50+
---------------------------------------------------------------------
51+
RUN tests/empty-comment-multi.hs
52+
FILE tests/empty-comment-multi.hs
3053

3154
{--}
3255
commentMultiEmpty = 1
@@ -61,122 +84,128 @@ haddockBelowMultiEmptyLines = 1
6184

6285
-}
6386

64-
data HaddockSingle = HaddockSingle
65-
{ haddockFieldEmptyBelow :: Int
66-
-- ^
67-
-- |
68-
, haddockFieldAboveEmpty :: Int
69-
, haddockFieldEmptyAfter :: Int -- ^
70-
}
71-
72-
data HaddockMulti = HaddockMulti
73-
{ haddockFieldEmptyBelow :: Int
74-
{- ^-}
75-
{- |-}
76-
, haddockFieldAboveEmpty :: Int
77-
, haddockFieldEmptyAfter :: Int {- ^-}
78-
}
79-
8087
OUTPUT
81-
tests/empty-comment.hs:2:1-4: Suggestion: Empty single-line haddock
82-
Found:
83-
-- |
84-
Perhaps you should remove it.
85-
86-
tests/empty-comment.hs:6:1-4: Suggestion: Empty single-line haddock
87-
Found:
88-
-- ^
89-
Perhaps you should remove it.
90-
91-
tests/empty-comment.hs:8:1-4: Suggestion: Empty single-line haddock
92-
Found:
93-
-- |
94-
Perhaps you should remove it.
95-
96-
tests/empty-comment.hs:9:1-2: Suggestion: Empty single-line comment
97-
Found:
98-
--
99-
Perhaps you should remove it.
100-
101-
tests/empty-comment.hs:28:1-4: Suggestion: Empty multi-line comment
88+
tests/empty-comment-multi.hs:2:1-4: Suggestion: Empty multi-line comment
10289
Found:
10390
{--}
10491
Perhaps you should remove it.
10592

106-
tests/empty-comment.hs:31:1-5: Suggestion: Empty multi-line comment
93+
tests/empty-comment-multi.hs:5:1-5: Suggestion: Empty multi-line comment
10794
Found:
10895
{- -}
10996
Perhaps you should remove it.
11097

111-
tests/empty-comment.hs:(34,1)-(36,6): Suggestion: Empty multi-line comment
98+
tests/empty-comment-multi.hs:(8,1)-(10,6): Suggestion: Empty multi-line comment
11299
Found:
113100
{-
114101

115102
-}
116103
Perhaps you should remove it.
117104

118-
tests/empty-comment.hs:39:1-6: Suggestion: Empty multi-line haddock
105+
tests/empty-comment-multi.hs:13:1-6: Suggestion: Empty multi-line haddock
119106
Found:
120107
{- |-}
121108
Perhaps you should remove it.
122109

123-
tests/empty-comment.hs:42:1-7: Suggestion: Empty multi-line haddock
110+
tests/empty-comment-multi.hs:16:1-7: Suggestion: Empty multi-line haddock
124111
Found:
125112
{- | -}
126113
Perhaps you should remove it.
127114

128-
tests/empty-comment.hs:(45,1)-(47,6): Suggestion: Empty multi-line haddock
115+
tests/empty-comment-multi.hs:(19,1)-(21,6): Suggestion: Empty multi-line haddock
129116
Found:
130117
{- |
131118

132119
-}
133120
Perhaps you should remove it.
134121

135-
tests/empty-comment.hs:51:1-6: Suggestion: Empty multi-line haddock
122+
tests/empty-comment-multi.hs:25:1-6: Suggestion: Empty multi-line haddock
136123
Found:
137124
{- ^-}
138125
Perhaps you should remove it.
139126

140-
tests/empty-comment.hs:54:1-6: Suggestion: Empty multi-line haddock
127+
tests/empty-comment-multi.hs:28:1-6: Suggestion: Empty multi-line haddock
141128
Found:
142129
{- ^-}
143130
Perhaps you should remove it.
144131

145-
tests/empty-comment.hs:(57,1)-(59,6): Suggestion: Empty multi-line haddock
132+
tests/empty-comment-multi.hs:(31,1)-(33,6): Suggestion: Empty multi-line haddock
146133
Found:
147134
{- ^
148135

149136
-}
150137
Perhaps you should remove it.
151138

152-
tests/empty-comment.hs:63:3-6: Suggestion: Empty single-line haddock
139+
9 hints
140+
141+
---------------------------------------------------------------------
142+
RUN tests/empty-comment-nonempty.hs
143+
FILE tests/empty-comment-nonempty.hs
144+
145+
-- |
146+
--
147+
--
148+
-- foo
149+
haddockAboveIntoNonEmpty = 1
150+
151+
haddockBelowIntoNonEmpty = 1
152+
-- ^
153+
--
154+
--
155+
-- foo
156+
157+
OUTPUT
158+
No hints
159+
160+
---------------------------------------------------------------------
161+
RUN tests/empty-comment-record.hs
162+
FILE tests/empty-comment-record.hs
163+
164+
data HaddockSingle = HaddockSingle
165+
{ haddockFieldEmptyBelow :: Int
166+
-- ^
167+
-- |
168+
, haddockFieldAboveEmpty :: Int
169+
, haddockFieldEmptyAfter :: Int -- ^
170+
}
171+
172+
data HaddockMulti = HaddockMulti
173+
{ haddockFieldEmptyBelow :: Int
174+
{- ^-}
175+
{- |-}
176+
, haddockFieldAboveEmpty :: Int
177+
, haddockFieldEmptyAfter :: Int {- ^-}
178+
}
179+
180+
OUTPUT
181+
tests/empty-comment-record.hs:4:3-6: Suggestion: Empty single-line haddock
153182
Found:
154183
-- ^
155184
Perhaps you should remove it.
156185

157-
tests/empty-comment.hs:64:3-6: Suggestion: Empty single-line haddock
186+
tests/empty-comment-record.hs:5:3-6: Suggestion: Empty single-line haddock
158187
Found:
159188
-- |
160189
Perhaps you should remove it.
161190

162-
tests/empty-comment.hs:66:35-38: Suggestion: Empty single-line haddock
191+
tests/empty-comment-record.hs:7:35-38: Suggestion: Empty single-line haddock
163192
Found:
164193
-- ^
165194
Perhaps you should remove it.
166195

167-
tests/empty-comment.hs:71:3-8: Suggestion: Empty multi-line haddock
196+
tests/empty-comment-record.hs:12:3-8: Suggestion: Empty multi-line haddock
168197
Found:
169198
{- ^-}
170199
Perhaps you should remove it.
171200

172-
tests/empty-comment.hs:72:3-8: Suggestion: Empty multi-line haddock
201+
tests/empty-comment-record.hs:13:3-8: Suggestion: Empty multi-line haddock
173202
Found:
174203
{- |-}
175204
Perhaps you should remove it.
176205

177-
tests/empty-comment.hs:74:35-40: Suggestion: Empty multi-line haddock
206+
tests/empty-comment-record.hs:15:35-40: Suggestion: Empty multi-line haddock
178207
Found:
179208
{- ^-}
180209
Perhaps you should remove it.
181210

182-
19 hints
211+
6 hints

0 commit comments

Comments
 (0)