4 use Test::More tests => 10;
7 my $x = $^O eq 'MSWin32' ? ".exe" : "";
10 my ($command, $expected) = @_;
11 my $output = `$command$x 2>&1`;
12 eq_or_diff($output, $expected, $command);
15 cmd_eq_or_diff "t/cmpok", <<END;
18 # Failed test at t/cmpok.c line 6.
22 not ok 2 - the number 23 is definitely 55
23 # Failed test 'the number 23 is definitely 55'
24 # at t/cmpok.c line 7.
29 # Failed test at t/cmpok.c line 8.
34 # unrecognized operator 'frob'
36 # Failed test at t/cmpok.c line 10.
42 # Failed test at t/cmpok.c line 12.
48 # Failed test at t/cmpok.c line 14.
52 # Looks like you failed 6 tests of 9 run.
55 cmd_eq_or_diff "t/cmp_mem", <<END;
57 ok 1 - Same array different address
58 ok 2 - Array must be equal to itself
59 not ok 3 - Arrays with different contents
60 # Failed test 'Arrays with different contents'
61 # at t/cmp_mem.c line 13.
62 # Difference starts at offset 0
65 not ok 4 - Arrays differ, but start the same
66 # Failed test 'Arrays differ, but start the same'
67 # at t/cmp_mem.c line 14.
68 # Difference starts at offset 2
71 ok 5 - Comparing 0 bytes of different arrays
72 not ok 6 - got == NULL
73 # Failed test 'got == NULL'
74 # at t/cmp_mem.c line 16.
77 not ok 7 - expected == NULL
78 # Failed test 'expected == NULL'
79 # at t/cmp_mem.c line 17.
82 ok 8 - got == expected == NULL
83 # Looks like you failed 4 tests of 8 run.
86 cmd_eq_or_diff "t/diesok", <<END;
89 ok 2 - can't divide by zero
90 ok 3 - this is a perfectly fine statement
91 ok 4 - abort kills the program
95 cmd_eq_or_diff "t/is", <<END;
97 not ok 1 - this is that
98 # Failed test 'this is that'
104 # Failed test at t/is.c line 8.
109 not ok 6 - null is this
110 # Failed test 'null is this'
114 not ok 7 - this is null
115 # Failed test 'this is null'
120 # Failed test at t/is.c line 13.
128 ok 10 - this isnt that
129 not ok 11 - this isnt this
130 # Failed test 'this isnt this'
133 # expected: anything else
136 # Failed test at t/is.c line 18.
138 # expected: anything else
139 not ok 14 - null isnt null
140 # Failed test 'null isnt null'
143 # expected: anything else
144 ok 15 - null isnt this
145 ok 16 - this isnt null
148 # Failed test at t/is.c line 23.
152 # expected: anything else
153 # Looks like you failed 9 tests of 18 run.
156 cmd_eq_or_diff "t/like", <<END;
158 ok 1 - strange ~~ /range/
159 ok 2 - strange !~~ /anger/
160 ok 3 - matches the regex
163 cmd_eq_or_diff "t/notediag", <<END;
170 cmd_eq_or_diff "t/simple", <<END;
176 # Failed test at t/simple.c line 9.
185 not ok 13 - frobnicate
186 # Failed test 'frobnicate'
187 # at t/simple.c line 18.
197 # Failed test at t/simple.c line 27.
201 # at t/simple.c line 29.
202 # Looks like you failed 4 tests of 24 run.
205 cmd_eq_or_diff "t/skip", <<END;
210 ok 4 # skip need to be on windows
217 cmd_eq_or_diff "t/synopsis", <<END;
220 not ok 2 - two different strings not that way?
221 # Failed test 'two different strings not that way?'
222 # at t/synopsis.c line 7.
228 # Failed test at t/synopsis.c line 10.
232 # Looks like you failed 2 tests of 5 run.
235 cmd_eq_or_diff "t/todo", <<END;
237 not ok 1 - foo # TODO
238 # Failed (TODO) test 'foo'
239 # at t/todo.c line 7.
242 not ok 4 - quux # TODO im not ready
243 # Failed (TODO) test 'quux'
244 # at t/todo.c line 12.
245 ok 5 - thud # TODO im not ready
246 ok 6 - wombat # TODO im not ready