]> code.delx.au - offlineimap/commitdiff
Finish lines identity test
authorJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 01:55:44 +0000 (20:55 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Tue, 12 Aug 2008 01:55:44 +0000 (20:55 -0500)
testsrc/TestConnection.hs

index e513557c9ac19dcf89594ec82e047ee542142342..418a514e6b32dd3ca2639ab916c169243ea1115e 100644 (file)
@@ -33,13 +33,18 @@ prop_linesidentity :: String -> Bool
 prop_linesidentity f =
     runLinesConnection [f] (\_ -> return ()) == ((), (f ++ "\r\n", []))
 
-prop_lineslistidentity :: String -> Bool
+prop_lineslistidentity :: [String] -> Bool
 prop_lineslistidentity f =
-    runLinesConnection f (\_ -> return ()) == ((), 
+    runLinesConnection f (\_ -> return ()) == ((), (expected, []))
+    where expected = 
+              case f of
+                [] -> []
+                _ -> (intercalate "\r\n" f) ++ "\r\n"
 
 q :: Testable a => String -> a -> HU.Test
 q = qccheck (defaultConfig {configMaxTest = 250})
 
 allt = [q "Identity" prop_identity,
         q "Lines identity" prop_linesidentity,
+        q "Lines list identity" prop_lineslistidentity
        ]