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 # Looks like you failed 2 tests of 4 run.
74 cmd_eq_or_diff "t/diesok", <<END;
77 ok 2 - can't divide by zero
78 ok 3 - this is a perfectly fine statement
79 ok 4 - abort kills the program
83 cmd_eq_or_diff "t/is", <<END;
85 not ok 1 - this is that
86 # Failed test 'this is that'
92 # Failed test at t/is.c line 8.
97 not ok 6 - null is this
98 # Failed test 'null is this'
102 not ok 7 - this is null
103 # Failed test 'this is null'
108 # Failed test at t/is.c line 13.
116 ok 10 - this isnt that
117 not ok 11 - this isnt this
118 # Failed test 'this isnt this'
121 # expected: anything else
124 # Failed test at t/is.c line 18.
126 # expected: anything else
127 not ok 14 - null isnt null
128 # Failed test 'null isnt null'
131 # expected: anything else
132 ok 15 - null isnt this
133 ok 16 - this isnt null
136 # Failed test at t/is.c line 23.
140 # expected: anything else
141 # Looks like you failed 9 tests of 18 run.
144 cmd_eq_or_diff "t/like", <<END;
146 ok 1 - strange ~~ /range/
147 ok 2 - strange !~~ /anger/
148 ok 3 - matches the regex
151 cmd_eq_or_diff "t/notediag", <<END;
158 cmd_eq_or_diff "t/simple", <<END;
164 # Failed test at t/simple.c line 9.
173 not ok 13 - frobnicate
174 # Failed test 'frobnicate'
175 # at t/simple.c line 18.
185 # Failed test at t/simple.c line 27.
189 # at t/simple.c line 29.
190 # Looks like you failed 4 tests of 24 run.
193 cmd_eq_or_diff "t/skip", <<END;
198 ok 4 # skip need to be on windows
205 cmd_eq_or_diff "t/synopsis", <<END;
208 not ok 2 - two different strings not that way?
209 # Failed test 'two different strings not that way?'
210 # at t/synopsis.c line 7.
216 # Failed test at t/synopsis.c line 10.
220 # Looks like you failed 2 tests of 5 run.
223 cmd_eq_or_diff "t/todo", <<END;
225 not ok 1 - foo # TODO
226 # Failed (TODO) test 'foo'
227 # at t/todo.c line 7.
230 not ok 4 - quux # TODO im not ready
231 # Failed (TODO) test 'quux'
232 # at t/todo.c line 12.
233 ok 5 - thud # TODO im not ready
234 ok 6 - wombat # TODO im not ready