-
Notifications
You must be signed in to change notification settings - Fork 0
/
TodoTest.hs
44 lines (38 loc) · 1.2 KB
/
TodoTest.hs
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
{- AUTOCOLLECT.TEST -}
{-# LANGUAGE OverloadedStrings #-}
module Test.Tasty.Ext.TodoTest (
-- $AUTOCOLLECT.TEST.export$
) where
import qualified Data.Text as Text
import Test.Predicates
import Test.Predicates.HUnit
import Test.Tasty.HUnit
import TestUtils.Integration
import TestUtils.Predicates
test_testCase :: Assertion
test_testCase "TODO tests appear as successful tests" = do
(stdout, _) <-
assertSuccess $
runTest
[ "test_todo :: ()"
, "test_todo \"a skipped test\" = ()"
]
Text.lines stdout @?~ contains (strippedEq "a skipped test: TODO")
test_testCase :: Assertion
test_testCase "TODO tests can wrap any type" =
assertSuccess_ $
runTest
[ "test_todo :: Int"
, "test_todo \"todo with int\" = 1"
, "test_todo :: Bool"
, "test_todo \"todo with bool\" = True"
]
test_testCase :: Assertion
test_testCase "TODO tests show compilation errors" = do
(_, stderr) <-
assertAnyFailure $
runTest
[ "test_todo :: Assertion"
, "test_todo \"partially implemented todo\" = length [] @?= True"
]
Text.lines stderr @?~ contains (strippedEq "• Couldn't match expected type ‘Int’ with actual type ‘Bool’")