Prefix pass test output with the pass name ++ ": " consistently.
This commit is contained in:
parent
06ad1e5e06
commit
62b9c9b105
|
@ -291,12 +291,15 @@ testPassGetItems testName expected actualPass startStateTrans =
|
||||||
--passResult :: Either String b
|
--passResult :: Either String b
|
||||||
do passResult <- runPass actualPass startState
|
do passResult <- runPass actualPass startState
|
||||||
case passResult of
|
case passResult of
|
||||||
(st,Left (_,err)) -> return (st, Left $ assertFailure (testName ++ "; pass actually failed: " ++ err))
|
(st, Left (_, err)) -> return (st, Left $ assertFailure (prefixErr $ "pass actually failed: " ++ err))
|
||||||
(st,Right resultItem) -> return (st, transformEither (sequence_ . map (assertFailure . ((++) testName))) (id) $ getMatchedItems expected resultItem )
|
(st, Right resultItem) -> return (st, transformEither (mapM_ (assertFailure . prefixErr)) (id) $ getMatchedItems expected resultItem)
|
||||||
where
|
where
|
||||||
startState :: CompState
|
startState :: CompState
|
||||||
startState = execState startStateTrans emptyState
|
startState = execState startStateTrans emptyState
|
||||||
|
|
||||||
|
prefixErr :: String -> String
|
||||||
|
prefixErr err = testName ++ ": " ++ err
|
||||||
|
|
||||||
-- | Runs a given AST pass and returns the subsequent state, along with either an error or the result. This function is primarily intended for internal use by this module.
|
-- | Runs a given AST pass and returns the subsequent state, along with either an error or the result. This function is primarily intended for internal use by this module.
|
||||||
runPass ::
|
runPass ::
|
||||||
PassM b -- ^ The actual pass.
|
PassM b -- ^ The actual pass.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user