From: John Goerzen Date: Tue, 12 Aug 2008 01:55:44 +0000 (-0500) Subject: Finish lines identity test X-Git-Url: https://code.delx.au/offlineimap/commitdiff_plain/90b0719b6c55296e46ff87250a41a1605010dea5?ds=sidebyside Finish lines identity test --- diff --git a/testsrc/TestConnection.hs b/testsrc/TestConnection.hs index e513557..418a514 100644 --- a/testsrc/TestConnection.hs +++ b/testsrc/TestConnection.hs @@ -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 ]