Skip to content

Commit

Permalink
add parsing timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdagos committed Aug 18, 2016
1 parent ad6fd53 commit 54e2166
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ testExpectations = getFiles "test/examples/" >>=
-- | Parsing test tree
parsing :: IO TestTree
parsing = getFiles "test/parser_tests/" >>=
\files -> return $ testGroup "Parsing tests" $ map testParseFailes files
\files -> return $ testGroup "Parsing tests" $ map testParseFiles files

--------------------------------------------------------------------------------
-- | For an example file, get a test tree
Expand Down Expand Up @@ -128,9 +128,10 @@ createTmpFile = do tmpdir <- getTemporaryDirectory

--------------------------------------------------------------------------------
-- | For a file name, parse it and assert that it was parsed correctly
testParseFailes :: String -> TestTree
testParseFailes f = testCase ("Parsing file: " `mappend` f) fileAssertion
where
testParseFiles :: String -> TestTree
testParseFiles f = localOption (mkTimeout 50000) $
testCase ("Parsing file: " `mappend` f) fileAssertion
where
fileAssertion :: Assertion
fileAssertion = do (_, b) <- parse' f
b @?= True
Expand Down

0 comments on commit 54e2166

Please sign in to comment.