oneTesting :: S.State -> (QCGen -> Int -> (a -> Prop)) -> IO (Maybe a, Result)
doneTesting st _f =
  do -- CALLBACK done_testing?
     if S.expectedFailure st then
       putPart (S.terminal st)
         ( "+++ OK, passed "
        ++ show (S.numSuccessTests st)
        ++ " tests"
         )
      else
       putPart (S.terminal st)
         ( bold ("*** Failed!")
        ++ " Passed "
        ++ show (S.numSuccessTests st)
        ++ " tests (expected failure)"
         )
     success st
     theOutput <- terminalOutput (S.terminal st)
     return $ (Nothing, if S.expectedFailure st then
                          Success{ labels = summary st,
                                   numTests = S.numSuccessTests st,
                                   output = theOutput }
                        else NoExpectedFailure{ labels = summary st,
                                                numTests = S.numSuccessTests st,
                                                output = theOutput })

doneTesting :: S.State -> (QCGen -> Int -> (a -> Prop)) -> IO (Maybe a, Result)
doneTesting st _f =
  do -- CALLBACK done_testing?
     if S.expectedFailure st then
       putPart (S.terminal st)
         ( "+++ OK, passed "
        ++ show (S.numSuccessTests st)
        ++ " tests"
         )
      else
       putPart (S.terminal st)
         ( bold ("*** Failed!")
        ++ " Passed "
        ++ show (S.numSuccessTests st)
        ++ " tests (expected failure)"
         )
     success st
     theOutput <- terminalOutput (S.terminal st)
     return $ (Nothing, if S.expectedFailure st then
                          Success{ labels = summary st,
                                   numTests = S.numSuccessTests st,
                                   output = theOutput }
                        else NoExpectedFailure{ labels = summary st,
                                                numTests = S.numSuccessTests st,
                                                output = theOutput })
doneTesting st _f =
  do -- CALLBACK done_testing?
     if S.expectedFailure st then
       putPart (S.terminal st)
         ( "+++ OK, passed "
        ++ show (S.numSuccessTests st)
        ++ " tests"
         )
      else
       putPart (S.terminal st)
         ( bold ("*** Failed!")
        ++ " Passed "
        ++ show (S.numSuccessTests st)
        ++ " tests (expected failure)"
         )
     success st
     theOutput <- terminalOutput (S.terminal st)
     return $ (Nothing, if S.expectedFailure st then
                          Success{ labels = summary st,
                                   numTests = S.numSuccessTests st,
                                   output = theOutput }
                        else NoExpectedFailure{ labels = summary st,
                                                numTests = S.numSuccessTests st,
                                                output = theOutput })