From 141366adff7ef2b2b5caca640498e0ecca807dfc Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Tue, 12 Aug 2008 08:51:21 -0500 Subject: [PATCH 1/1] Initial prop_getFullLine_count --- testsrc/TestParser.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/testsrc/TestParser.hs b/testsrc/TestParser.hs index 124751c..4049869 100644 --- a/testsrc/TestParser.hs +++ b/testsrc/TestParser.hs @@ -39,5 +39,17 @@ prop_getFullLine_basic s = then Left "EOF in input in readLine" else Right (head s, (expectedString (tail s), [])) -allt = [q "getFullLine_basic" prop_getFullLine_basic +prop_getFullLine_count :: [String] -> Property +prop_getFullLine_count s = + length s >= 2 && noCR s && (length s < 3 || not ("}" `isSuffixOf` (s !! 2))) + ==> + runLinesConnection lenS (getFullLine []) @?= + Right (expectedResult, (expectedRemain, [])) + where lenS = [head s ++ "{" ++ show (length (s !! 1)) ++ "}\r\n" ++ (s !! 1)] + ++ (drop 2 s) + expectedResult = concat (take 2 s) + expectedRemain = expectedString (drop 2 s) + +allt = [q "getFullLine_basic" prop_getFullLine_basic, + q "getFullLine_count" prop_getFullLine_count ] -- 2.39.2