module Test.Tasty.Providers
( IsTest(..)
, testPassed
, testFailed
, testFailedDetails
, Result
, Progress(..)
, TestName
, TestTree
, singleTest
)
where
import Test.Tasty.Core
import Test.Tasty.Providers.ConsoleFormat (ResultDetailsPrinter, noResultDetails)
singleTest :: IsTest t => TestName -> t -> TestTree
singleTest :: forall t. IsTest t => TestName -> t -> TestTree
singleTest = TestName -> t -> TestTree
forall t. IsTest t => TestName -> t -> TestTree
SingleTest
testPassed
:: String
-> Result
testPassed :: TestName -> Result
testPassed TestName
desc = Result
{ resultOutcome :: Outcome
resultOutcome = Outcome
Success
, resultDescription :: TestName
resultDescription = TestName
desc
, resultShortDescription :: TestName
resultShortDescription = TestName
"OK"
, resultTime :: Time
resultTime = Time
0
, resultDetailsPrinter :: ResultDetailsPrinter
resultDetailsPrinter = ResultDetailsPrinter
noResultDetails
}
testFailed
:: String
-> Result
testFailed :: TestName -> Result
testFailed TestName
desc = Result
{ resultOutcome :: Outcome
resultOutcome = FailureReason -> Outcome
Failure FailureReason
TestFailed
, resultDescription :: TestName
resultDescription = TestName
desc
, resultShortDescription :: TestName
resultShortDescription = TestName
"FAIL"
, resultTime :: Time
resultTime = Time
0
, resultDetailsPrinter :: ResultDetailsPrinter
resultDetailsPrinter = ResultDetailsPrinter
noResultDetails
}
testFailedDetails
:: String
-> ResultDetailsPrinter
-> Result
testFailedDetails :: TestName -> ResultDetailsPrinter -> Result
testFailedDetails TestName
desc ResultDetailsPrinter
printer = (TestName -> Result
testFailed TestName
desc)
{ resultDetailsPrinter :: ResultDetailsPrinter
resultDetailsPrinter = ResultDetailsPrinter
printer }