X-Git-Url: https://code.delx.au/offlineimap/blobdiff_plain/2cbc7b5013de5fb1d9266b00816375228dcd9470..beabf8c812d4728f258ca5404dc7009cc0c571b2:/testsrc/TestParserPrim.hs diff --git a/testsrc/TestParserPrim.hs b/testsrc/TestParserPrim.hs index 36d4460..8737c93 100644 --- a/testsrc/TestParserPrim.hs +++ b/testsrc/TestParserPrim.hs @@ -95,12 +95,23 @@ prop_text s = else Nothing where isValid = not (null s) && all (`notElem` crlf) s +prop_tag :: String -> Result +prop_tag s = + p tag s @=? if isValid + then Just s + else Nothing + where isValid = not (null s) && all isValidChar s + isValidChar c = + c `notElem` ('+' : atomSpecials) || + c `elem` respSpecials + allt = [q "quoted" prop_quoted, q "literal" prop_literal, q "string3501" prop_string3501, q "atom" prop_atom, q "astring basic" prop_astring_basic, q "astring full" prop_astring, - q "text" prop_text + q "text" prop_text, + q "tag" prop_tag ]