path' = HU.showPath (HU.path ss)
q :: Testable a => String -> a -> HU.Test
-q = qccheck (defaultConfig {configMaxTest = 250, configMaxFail = 10000,
+q = qccheck (defaultConfig {configMaxTest = 250, configMaxFail = 20000,
configEvery = \_ _ -> ""})
-- configEvery = testCount for displaying a running test counter
where testCountBase n = " (test " ++ show n ++ "/250)"
testCount n _ = testCountBase n ++
replicate (length (testCountBase n)) '\b'
+qverbose :: Testable a => String -> a -> HU.Test
+qverbose = qccheck (defaultConfig {configMaxTest = 250, configMaxFail = 20000,
+ configEvery = \n args -> show n ++ ":\n" ++ unlines args})
+
+
{- | Test a parser, forcing it to apply to all input. -}
p parser input =
case parse parseTest "(none)" input of
then Just s
else Nothing
+prop_astring_basic_thorough :: String -> Property
+prop_astring_basic_thorough s =
+ isValidAtom s ==> p astring s @?= Just s
+
isValidAtom s = not (null s) && all isValidChar s
where isValidChar c =
c `notElem` atomSpecials ||
q "string3501" prop_string3501,
q "atom" prop_atom,
q "astring basic" prop_astring_basic,
+ qverbose "astring basic thorough" prop_astring_basic_thorough,
q "astring full" prop_astring,
q "text" prop_text,
q "tag" prop_tag