@@ -5,23 +5,24 @@ test_description='Test the output of the unit test framework'
55TEST_PASSES_SANITIZE_LEAK=true
66. ./test-lib.sh
77
8- test_expect_success ' TAP output from unit tests' '
8+ test_expect_success ' TAP output from unit tests' - << \ EOT
99 cat >expect <<-EOF &&
10+ # BUG: check outside of test at t/helper/test-example-tap.c:75
1011 ok 1 - passing test
1112 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
1314 # left: 1
1415 # right: 2
1516 not ok 3 - failing test
1617 ok 4 - failing test and assertion return 0
1718 not ok 5 - passing TEST_TODO() # TODO
1819 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
2021 not ok 7 - failing TEST_TODO()
2122 ok 8 - failing TEST_TODO() returns 0
2223 # check "0" failed at t/helper/test-example-tap.c:31
2324 # 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
2526 ok 9 - test_skip() # SKIP
2627 ok 10 - skipped test returns 1
2728 # skipping test - missing prerequisite
@@ -39,21 +40,54 @@ test_expect_success 'TAP output from unit tests' '
3940 # check "!strcmp("NULL", NULL)" failed at t/helper/test-example-tap.c:63
4041 # left: "NULL"
4142 # 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: ' \\ ''
4849 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
5051 not ok 18 - test with no checks
5152 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
5387 EOF
5488
5589 ! test-tool example-tap >actual &&
5690 test_cmp expect actual
57- '
91+ EOT
5892
5993test_done
0 commit comments