From 17b59c6cbdcf488945cd8688733f5b0513efc8e4 Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Tue, 12 Aug 2008 03:06:27 -0500 Subject: [PATCH 1/1] Working on respText --- src/Network/IMAP/Parser.hs | 3 +-- testsrc/TestInfrastructure.hs | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) 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 -- 2.39.2