Apply brittany
parent
bc70eb07e8
commit
93611b9a1c
|
@ -42,8 +42,8 @@ main = do
|
||||||
hspec $ groups `forM_` \(groupname, tests) -> do
|
hspec $ groups `forM_` \(groupname, tests) -> do
|
||||||
describe (Text.unpack groupname) $ tests `forM_` \(name, pend, inp) -> do
|
describe (Text.unpack groupname) $ tests `forM_` \(name, pend, inp) -> do
|
||||||
(if pend then before_ pending else id)
|
(if pend then before_ pending else id)
|
||||||
$ it (Text.unpack name) $ roundTripEqual inp
|
$ it (Text.unpack name)
|
||||||
|
$ roundTripEqual inp
|
||||||
where
|
where
|
||||||
-- this function might be implemented in a weirdly complex fashion; the
|
-- this function might be implemented in a weirdly complex fashion; the
|
||||||
-- reason being that it was copied from a somewhat more complex variant.
|
-- reason being that it was copied from a somewhat more complex variant.
|
||||||
|
@ -55,13 +55,22 @@ main = do
|
||||||
-- l -> error $ "first non-empty line must start with #test footest\n" ++ show l
|
-- l -> error $ "first non-empty line must start with #test footest\n" ++ show l
|
||||||
-- )
|
-- )
|
||||||
-- $ fmap (groupBy grouperT)
|
-- $ fmap (groupBy grouperT)
|
||||||
fmap (\case
|
fmap
|
||||||
|
( \case
|
||||||
GroupLine g:grouprest ->
|
GroupLine g:grouprest ->
|
||||||
(,) g
|
(,) g
|
||||||
$ fmap (\case
|
$ fmap
|
||||||
HeaderLine n:PendingLine:rest | Just rlines <- mapM extractNormal rest -> (n, True, Text.unlines rlines)
|
( \case
|
||||||
HeaderLine n:rest | Just rlines <- mapM extractNormal rest -> (n, False, Text.unlines rlines)
|
HeaderLine n:PendingLine:rest | Just rlines <- mapM
|
||||||
l -> error $ "first non-empty line must start with #test footest\n" ++ show l
|
extractNormal
|
||||||
|
rest ->
|
||||||
|
(n, True, Text.unlines rlines)
|
||||||
|
HeaderLine n:rest | Just rlines <- mapM extractNormal rest ->
|
||||||
|
(n, False, Text.unlines rlines)
|
||||||
|
l ->
|
||||||
|
error
|
||||||
|
$ "first non-empty line must start with #test footest\n"
|
||||||
|
++ show l
|
||||||
)
|
)
|
||||||
$ groupBy grouperT
|
$ groupBy grouperT
|
||||||
$ filter (not . lineIsSpace)
|
$ filter (not . lineIsSpace)
|
||||||
|
@ -96,7 +105,8 @@ main = do
|
||||||
]
|
]
|
||||||
, [ CommentLine
|
, [ CommentLine
|
||||||
| _ <- Parsec.many $ Parsec.oneOf " \t"
|
| _ <- Parsec.many $ Parsec.oneOf " \t"
|
||||||
, _ <- Parsec.optional $ Parsec.string "##" <* many (Parsec.noneOf "\r\n")
|
, _ <-
|
||||||
|
Parsec.optional $ Parsec.string "##" <* many (Parsec.noneOf "\r\n")
|
||||||
, _ <- Parsec.eof
|
, _ <- Parsec.eof
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue