From: John Goerzen Date: Tue, 12 Aug 2008 08:06:27 +0000 (-0500) Subject: Working on respText X-Git-Url: https://code.delx.au/offlineimap/commitdiff_plain/17b59c6cbdcf488945cd8688733f5b0513efc8e4?hp=9c0ecb25de2f0d1ea439e13859c712030f73c430 Working on respText --- diff --git a/src/Network/IMAP/Parser.hs b/src/Network/IMAP/Parser.hs index 23cf074..e945d5e 100644 --- a/src/Network/IMAP/Parser.hs +++ b/src/Network/IMAP/Parser.hs @@ -103,8 +103,7 @@ respText = where respTextCode = do char '[' a <- atom - sp - b <- option "" respTextCodeText + b <- option "" (sp >> respTextCodeText) char ']' sp return (a ++ " " ++ b) diff --git a/testsrc/TestInfrastructure.hs b/testsrc/TestInfrastructure.hs index 41419bd..9c22808 100644 --- a/testsrc/TestInfrastructure.hs +++ b/testsrc/TestInfrastructure.hs @@ -96,9 +96,14 @@ qverbose = qccheck (defaultConfig {configMaxTest = 250, configMaxFail = 20000, {- | Test a parser, forcing it to apply to all input. -} p parser input = - case parse parseTest "(none)" input of + case p' parser input of Left _ -> Nothing Right y -> Just y + +p' parser input = + case parse parseTest "(none)" input of + Left x -> Left (show x) + Right y -> Right y where parseTest = do r <- parser eof return r