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 - Array must be equal to itself
58 not ok 2 - Arrays with different contents
59 # Failed test 'Arrays with different contents'
60 # at t/cmp_mem.c line 11.
61 # Difference starts at offset 0
64 not ok 3 - Arrays differ, but start the same
65 # Failed test 'Arrays differ, but start the same'
66 # at t/cmp_mem.c line 12.
67 # Difference starts at offset 2
70 ok 4 - Comparing 0 bytes of different arrays
71 not ok 5 - got == NULL
72 # Failed test 'got == NULL'
73 # at t/cmp_mem.c line 14.
74 # got and/or expected are NULL
77 not ok 6 - expected == NULL
78 # Failed test 'expected == NULL'
79 # at t/cmp_mem.c line 15.
80 # got and/or expected are NULL
83 not ok 7 - got == expected == NULL
84 # Failed test 'got == expected == NULL'
85 # at t/cmp_mem.c line 16.
86 # got and/or expected are NULL
89 # Looks like you failed 5 tests of 7 run.
92 cmd_eq_or_diff "t/diesok", <<END;
95 ok 2 - can't divide by zero
96 ok 3 - this is a perfectly fine statement
97 ok 4 - abort kills the program
101 cmd_eq_or_diff "t/is", <<END;
103 not ok 1 - this is that
104 # Failed test 'this is that'
110 # Failed test at t/is.c line 8.
115 not ok 6 - null is this
116 # Failed test 'null is this'
120 not ok 7 - this is null
121 # Failed test 'this is null'
126 # Failed test at t/is.c line 13.
134 ok 10 - this isnt that
135 not ok 11 - this isnt this
136 # Failed test 'this isnt this'
139 # expected: anything else
142 # Failed test at t/is.c line 18.
144 # expected: anything else
145 not ok 14 - null isnt null
146 # Failed test 'null isnt null'
149 # expected: anything else
150 ok 15 - null isnt this
151 ok 16 - this isnt null
154 # Failed test at t/is.c line 23.
158 # expected: anything else
159 # Looks like you failed 9 tests of 18 run.
162 cmd_eq_or_diff "t/like", <<END;
164 ok 1 - strange ~~ /range/
165 ok 2 - strange !~~ /anger/
166 ok 3 - matches the regex
169 cmd_eq_or_diff "t/notediag", <<END;
176 cmd_eq_or_diff "t/simple", <<END;
182 # Failed test at t/simple.c line 9.
191 not ok 13 - frobnicate
192 # Failed test 'frobnicate'
193 # at t/simple.c line 18.
203 # Failed test at t/simple.c line 27.
207 # at t/simple.c line 29.
208 # Looks like you failed 4 tests of 24 run.
211 cmd_eq_or_diff "t/skip", <<END;
216 ok 4 # skip need to be on windows
223 cmd_eq_or_diff "t/synopsis", <<END;
226 not ok 2 - two different strings not that way?
227 # Failed test 'two different strings not that way?'
228 # at t/synopsis.c line 7.
234 # Failed test at t/synopsis.c line 10.
238 # Looks like you failed 2 tests of 5 run.
241 cmd_eq_or_diff "t/todo", <<END;
243 not ok 1 - foo # TODO
244 # Failed (TODO) test 'foo'
245 # at t/todo.c line 7.
248 not ok 4 - quux # TODO im not ready
249 # Failed (TODO) test 'quux'
250 # at t/todo.c line 12.
251 ok 5 - thud # TODO im not ready
252 ok 6 - wombat # TODO im not ready