From a8bbc9421996f8a74da8350ec09bb04874d8e4c2 Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Tue, 12 Aug 2008 03:11:30 -0500 Subject: [PATCH] More respText test. all tests pass. --- testsrc/TestParser.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/testsrc/TestParser.hs b/testsrc/TestParser.hs index 69a6bfb..86bb090 100644 --- a/testsrc/TestParser.hs +++ b/testsrc/TestParser.hs @@ -82,10 +82,18 @@ prop_respTextAtom s2 = Just (RespText (Just s2) s1) where s1 = reverse s2 -- Gen manually to avoid test exhaustion +prop_respTextAtomOpt :: String -> String -> String -> Property +prop_respTextAtomOpt codeatom codedesc text = + isValidAtom codeatom && isValidText codedesc && isValidText text && + ']' `notElem` (codeatom ++ codedesc) && + (head text) /= '[' ==> + p respText ("[" ++ codeatom ++ " " ++ codedesc ++ "] " ++ text) @?= + Just (RespText (Just (codeatom ++ " " ++ codedesc)) text) allt = [q "getFullLine_basic" prop_getFullLine_basic, q "getFullLine_count" prop_getFullLine_count, q "readFullResponse_basic" prop_rfr_basic, q "respText simple" prop_respTextSimple, - q "respText atom" prop_respTextAtom + q "respText atom" prop_respTextAtom, + q "respTextAtomOpt" prop_respTextAtomOpt ] -- 2.39.2