import System.Random
import Data.Word
import Test.HUnit.Utils
+import Text.ParserCombinators.Parsec
(@=?) :: (Eq a, Show a) => a -> a -> Result
expected @=? actual =
testCount n _ = testCountBase n ++
replicate (length (testCountBase n)) '\b'
+{- | Test a parser, forcing it to apply to all input. -}
+p parser input =
+ case parse parseTest "(none)" input of
+ Left _ -> Nothing
+ Right y -> Just y
+ where parseTest = do r <- parser
+ eof
+ return r
+