From 90b0719b6c55296e46ff87250a41a1605010dea5 Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Mon, 11 Aug 2008 20:55:44 -0500 Subject: [PATCH] Finish lines identity test --- testsrc/TestConnection.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 ] -- 2.39.2