-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathProviders.hs
More file actions
62 lines (57 loc) · 1.33 KB
/
Providers.hs
File metadata and controls
62 lines (57 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-- | API for test providers.
--
-- @since 0.1
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)
-- | Convert a test to a leaf of the 'TestTree'.
--
-- @since 0.1
singleTest :: IsTest t => TestName -> t -> TestTree
singleTest = SingleTest
-- | t'Result' of a passed test.
--
-- @since 0.8
testPassed
:: String -- ^ description (may be empty)
-> Result
testPassed desc = Result
{ resultOutcome = Success
, resultDescription = desc
, resultShortDescription = "OK"
, resultTime = 0
, resultDetailsPrinter = noResultDetails
}
-- | t'Result' of a failed test.
--
-- @since 0.8
testFailed
:: String -- ^ description
-> Result
testFailed desc = Result
{ resultOutcome = Failure TestFailed
, resultDescription = desc
, resultShortDescription = "FAIL"
, resultTime = 0
, resultDetailsPrinter = noResultDetails
}
-- | t'Result' of a failed test with custom details printer
--
-- @since 1.3.1
testFailedDetails
:: String -- ^ description
-> ResultDetailsPrinter -- ^ details printer
-> Result
testFailedDetails desc printer = (testFailed desc)
{ resultDetailsPrinter = printer }