@@ -5,23 +5,24 @@ test_description='Test the output of the unit test framework'
5
5
TEST_PASSES_SANITIZE_LEAK=true
6
6
. ./test-lib.sh
7
7
8
- test_expect_success ' TAP output from unit tests' '
8
+ test_expect_success ' TAP output from unit tests' - << \ EOT
9
9
cat >expect <<-EOF &&
10
+ # BUG: check outside of test at t/helper/test-example-tap.c:75
10
11
ok 1 - passing test
11
12
ok 2 - passing test and assertion return 1
12
- # check "1 == 2" failed at t/helper/test-example-tap.c:77
13
+ # check "1 == 2" failed at t/helper/test-example-tap.c:79
13
14
# left: 1
14
15
# right: 2
15
16
not ok 3 - failing test
16
17
ok 4 - failing test and assertion return 0
17
18
not ok 5 - passing TEST_TODO() # TODO
18
19
ok 6 - passing TEST_TODO() returns 1
19
- # todo check ${SQ} check(x)${SQ} succeeded at t/helper/test-example-tap.c:26
20
+ # todo check ' check(x)' succeeded at t/helper/test-example-tap.c:26
20
21
not ok 7 - failing TEST_TODO()
21
22
ok 8 - failing TEST_TODO() returns 0
22
23
# check "0" failed at t/helper/test-example-tap.c:31
23
24
# skipping test - missing prerequisite
24
- # skipping check ${SQ}1${SQ} at t/helper/test-example-tap.c:33
25
+ # skipping check '1' at t/helper/test-example-tap.c:33
25
26
ok 9 - test_skip() # SKIP
26
27
ok 10 - skipped test returns 1
27
28
# skipping test - missing prerequisite
@@ -39,21 +40,54 @@ test_expect_success 'TAP output from unit tests' '
39
40
# check "!strcmp("NULL", NULL)" failed at t/helper/test-example-tap.c:63
40
41
# left: "NULL"
41
42
# right: NULL
42
- # check "${SQ}a${SQ} == ${SQ}\n${SQ} " failed at t/helper/test-example-tap.c:64
43
- # left: ${SQ}a${SQ}
44
- # right: ${SQ} \012${SQ}
45
- # check "${SQ} \\\\${SQ} == ${SQ}\\${SQ}${SQ} " failed at t/helper/test-example-tap.c:65
46
- # left: ${SQ} \\\\${SQ}
47
- # right: ${SQ}\\${SQ}${SQ}
43
+ # check "'a' == '\n' " failed at t/helper/test-example-tap.c:64
44
+ # left: 'a'
45
+ # right: ' \012'
46
+ # check "' \\\\ ' == ' \\ '' " failed at t/helper/test-example-tap.c:65
47
+ # left: ' \\\\ '
48
+ # right: ' \\ ''
48
49
not ok 17 - messages from failing string and char comparison
49
- # BUG: test has no checks at t/helper/test-example-tap.c:92
50
+ # BUG: test has no checks at t/helper/test-example-tap.c:94
50
51
not ok 18 - test with no checks
51
52
ok 19 - test with no checks returns 0
52
- 1..19
53
+ ok 20 - if_test passing test
54
+ # check "1 == 2" failed at t/helper/test-example-tap.c:100
55
+ # left: 1
56
+ # right: 2
57
+ not ok 21 - if_test failing test
58
+ not ok 22 - if_test passing TEST_TODO() # TODO
59
+ # todo check 'check(1)' succeeded at t/helper/test-example-tap.c:104
60
+ not ok 23 - if_test failing TEST_TODO()
61
+ # check "0" failed at t/helper/test-example-tap.c:106
62
+ # skipping test - missing prerequisite
63
+ # skipping check '1' at t/helper/test-example-tap.c:108
64
+ ok 24 - if_test test_skip() # SKIP
65
+ # skipping test - missing prerequisite
66
+ ok 25 - if_test test_skip() inside TEST_TODO() # SKIP
67
+ # check "0" failed at t/helper/test-example-tap.c:113
68
+ not ok 26 - if_test TEST_TODO() after failing check
69
+ # check "0" failed at t/helper/test-example-tap.c:119
70
+ not ok 27 - if_test failing check after TEST_TODO()
71
+ # check "!strcmp("\thello\\\\ ", "there\"\n")" failed at t/helper/test-example-tap.c:122
72
+ # left: "\011hello\\\\ "
73
+ # right: "there\"\012"
74
+ # check "!strcmp("NULL", NULL)" failed at t/helper/test-example-tap.c:123
75
+ # left: "NULL"
76
+ # right: NULL
77
+ # check "'a' == '\n'" failed at t/helper/test-example-tap.c:124
78
+ # left: 'a'
79
+ # right: '\012'
80
+ # check "'\\\\ ' == '\\ ''" failed at t/helper/test-example-tap.c:125
81
+ # left: '\\\\ '
82
+ # right: '\\ ''
83
+ not ok 28 - if_test messages from failing string and char comparison
84
+ # BUG: test has no checks at t/helper/test-example-tap.c:127
85
+ not ok 29 - if_test test with no checks
86
+ 1..29
53
87
EOF
54
88
55
89
! test-tool example-tap >actual &&
56
90
test_cmp expect actual
57
- '
91
+ EOT
58
92
59
93
test_done
0 commit comments