]> code.delx.au - offlineimap/commitdiff
Working on respText
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 08:06:27 +0000 (03:06 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 08:06:27 +0000 (03:06 -0500)
src/Network/IMAP/Parser.hs
testsrc/TestInfrastructure.hs

index 23cf07461a0f89c3c12ef53bf001f86a5e673bde..e945d5efad4d23b16a6649d1c1426a6945e2dc00 100644 (file)
@@ -103,8 +103,7 @@ respText =
     where respTextCode =
               do char '['
                  a <- atom
-                 sp
-                 b <- option "" respTextCodeText
+                 b <- option "" (sp >> respTextCodeText)
                  char ']'
                  sp
                  return (a ++ " " ++ b)
index 41419bdddb9150b09afb03fba3c6ebe2fdd8d16d..9c228080bc3d61e84e54e12305e96d864d44ca13 100644 (file)
@@ -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