Skip to content

Commit

Permalink
Split empty line comment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Jul 26, 2024
1 parent d1dbaef commit a6dcef7
Showing 1 changed file with 93 additions and 64 deletions.
157 changes: 93 additions & 64 deletions tests/empty-comment.test
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
---------------------------------------------------------------------
RUN tests/empty-comment.hs
FILE tests/empty-comment.hs
RUN tests/empty-comment-single.hs
FILE tests/empty-comment-single.hs

-- |
haddockAboveSingle = 1

haddockBelowSingle = 1
-- ^

OUTPUT
tests/empty-comment-single.hs:2:1-4: Suggestion: Empty single-line haddock
Found:
-- |
Perhaps you should remove it.

tests/empty-comment-single.hs:6:1-4: Suggestion: Empty single-line haddock
Found:
-- ^
Perhaps you should remove it.

2 hints

---------------------------------------------------------------------
RUN tests/empty-comment-singles.hs
FILE tests/empty-comment-singles.hs

-- |
--
haddockAboveSingles = 1
Expand All @@ -16,17 +33,23 @@ haddockAboveSingles = 1
-- >>>
haddockAboveDoctest = 1

-- |
--
--
-- foo
haddockAboveIntoNonEmpty = 1
OUTPUT
tests/empty-comment-singles.hs:2:1-4: Suggestion: Empty single-line haddock
Found:
-- |
Perhaps you should remove it.

haddockBelowIntoNonEmpty = 1
-- ^
--
--
-- foo
tests/empty-comment-singles.hs:3:1-2: Suggestion: Empty single-line comment
Found:
--
Perhaps you should remove it.

2 hints


---------------------------------------------------------------------
RUN tests/empty-comment-multi.hs
FILE tests/empty-comment-multi.hs

{--}
commentMultiEmpty = 1
Expand Down Expand Up @@ -61,122 +84,128 @@ haddockBelowMultiEmptyLines = 1

-}

data HaddockSingle = HaddockSingle
{ haddockFieldEmptyBelow :: Int
-- ^
-- |
, haddockFieldAboveEmpty :: Int
, haddockFieldEmptyAfter :: Int -- ^
}

data HaddockMulti = HaddockMulti
{ haddockFieldEmptyBelow :: Int
{- ^-}
{- |-}
, haddockFieldAboveEmpty :: Int
, haddockFieldEmptyAfter :: Int {- ^-}
}

OUTPUT
tests/empty-comment.hs:2:1-4: Suggestion: Empty single-line haddock
Found:
-- |
Perhaps you should remove it.

tests/empty-comment.hs:6:1-4: Suggestion: Empty single-line haddock
Found:
-- ^
Perhaps you should remove it.

tests/empty-comment.hs:8:1-4: Suggestion: Empty single-line haddock
Found:
-- |
Perhaps you should remove it.

tests/empty-comment.hs:9:1-2: Suggestion: Empty single-line comment
Found:
--
Perhaps you should remove it.

tests/empty-comment.hs:28:1-4: Suggestion: Empty multi-line comment
tests/empty-comment-multi.hs:2:1-4: Suggestion: Empty multi-line comment
Found:
{--}
Perhaps you should remove it.

tests/empty-comment.hs:31:1-5: Suggestion: Empty multi-line comment
tests/empty-comment-multi.hs:5:1-5: Suggestion: Empty multi-line comment
Found:
{- -}
Perhaps you should remove it.

tests/empty-comment.hs:(34,1)-(36,6): Suggestion: Empty multi-line comment
tests/empty-comment-multi.hs:(8,1)-(10,6): Suggestion: Empty multi-line comment
Found:
{-

-}
Perhaps you should remove it.

tests/empty-comment.hs:39:1-6: Suggestion: Empty multi-line haddock
tests/empty-comment-multi.hs:13:1-6: Suggestion: Empty multi-line haddock
Found:
{- |-}
Perhaps you should remove it.

tests/empty-comment.hs:42:1-7: Suggestion: Empty multi-line haddock
tests/empty-comment-multi.hs:16:1-7: Suggestion: Empty multi-line haddock
Found:
{- | -}
Perhaps you should remove it.

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

-}
Perhaps you should remove it.

tests/empty-comment.hs:51:1-6: Suggestion: Empty multi-line haddock
tests/empty-comment-multi.hs:25:1-6: Suggestion: Empty multi-line haddock
Found:
{- ^-}
Perhaps you should remove it.

tests/empty-comment.hs:54:1-6: Suggestion: Empty multi-line haddock
tests/empty-comment-multi.hs:28:1-6: Suggestion: Empty multi-line haddock
Found:
{- ^-}
Perhaps you should remove it.

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

-}
Perhaps you should remove it.

tests/empty-comment.hs:63:3-6: Suggestion: Empty single-line haddock
9 hints

---------------------------------------------------------------------
RUN tests/empty-comment-nonempty.hs
FILE tests/empty-comment-nonempty.hs

-- |
--
--
-- foo
haddockAboveIntoNonEmpty = 1

haddockBelowIntoNonEmpty = 1
-- ^
--
--
-- foo

OUTPUT
No hints

---------------------------------------------------------------------
RUN tests/empty-comment-record.hs
FILE tests/empty-comment-record.hs

data HaddockSingle = HaddockSingle
{ haddockFieldEmptyBelow :: Int
-- ^
-- |
, haddockFieldAboveEmpty :: Int
, haddockFieldEmptyAfter :: Int -- ^
}

data HaddockMulti = HaddockMulti
{ haddockFieldEmptyBelow :: Int
{- ^-}
{- |-}
, haddockFieldAboveEmpty :: Int
, haddockFieldEmptyAfter :: Int {- ^-}
}

OUTPUT
tests/empty-comment-record.hs:4:3-6: Suggestion: Empty single-line haddock
Found:
-- ^
Perhaps you should remove it.

tests/empty-comment.hs:64:3-6: Suggestion: Empty single-line haddock
tests/empty-comment-record.hs:5:3-6: Suggestion: Empty single-line haddock
Found:
-- |
Perhaps you should remove it.

tests/empty-comment.hs:66:35-38: Suggestion: Empty single-line haddock
tests/empty-comment-record.hs:7:35-38: Suggestion: Empty single-line haddock
Found:
-- ^
Perhaps you should remove it.

tests/empty-comment.hs:71:3-8: Suggestion: Empty multi-line haddock
tests/empty-comment-record.hs:12:3-8: Suggestion: Empty multi-line haddock
Found:
{- ^-}
Perhaps you should remove it.

tests/empty-comment.hs:72:3-8: Suggestion: Empty multi-line haddock
tests/empty-comment-record.hs:13:3-8: Suggestion: Empty multi-line haddock
Found:
{- |-}
Perhaps you should remove it.

tests/empty-comment.hs:74:35-40: Suggestion: Empty multi-line haddock
tests/empty-comment-record.hs:15:35-40: Suggestion: Empty multi-line haddock
Found:
{- ^-}
Perhaps you should remove it.

19 hints
6 hints

0 comments on commit a6dcef7

Please sign in to comment.