nSingleTest :: CaughtMonadIO m => m () -> m TestResult
runSingleTest action = do
  let
    iohandler :: CaughtMonadIO m =>IOException -> m TestResult
    iohandler e = 
          let errText = trimCompilerPrefixes (ioeGetErrorString e) in
          if isPrefixOf exceptionPrefix errText
            then return (TestFailure (dropPrefix exceptionPrefix errText))
            else return (TestException (show e))
    errhandler :: CaughtMonadIO m => SomeException -> m TestResult
    errhandler e = return (TestException (show e))
  (action >> return TestSuccess)
    `gcatch` iohandler
    `gcatch` errhandler

-- Predicates for list filtering

runSingleTest :: CaughtMonadIO m => m () -> m TestResult
runSingleTest action = do
  let
    iohandler :: CaughtMonadIO m =>IOException -> m TestResult
    iohandler e = 
          let errText = trimCompilerPrefixes (ioeGetErrorString e) in
          if isPrefixOf exceptionPrefix errText
            then return (TestFailure (dropPrefix exceptionPrefix errText))
            else return (TestException (show e))
    errhandler :: CaughtMonadIO m => SomeException -> m TestResult
    errhandler e = return (TestException (show e))
  (action >> return TestSuccess)
    `gcatch` iohandler
    `gcatch` errhandler

-- Predicates for list filtering
runSingleTest action = do
  let
    iohandler :: CaughtMonadIO m =>IOException -> m TestResult
    iohandler e = 
          let errText = trimCompilerPrefixes (ioeGetErrorString e) in
          if isPrefixOf exceptionPrefix errText
            then return (TestFailure (dropPrefix exceptionPrefix errText))
            else return (TestException (show e))
    errhandler :: CaughtMonadIO m => SomeException -> m TestResult
    errhandler e = return (TestException (show e))
  (action >> return TestSuccess)
    `gcatch` iohandler
    `gcatch` errhandler

-- Predicates for list filtering