4 use Test::More tests => 9;
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/diesok", <<END;
58 ok 2 - can't divide by zero
59 ok 3 - this is a perfectly fine statement
60 ok 4 - abort kills the program
64 cmd_eq_or_diff "t/is", <<END;
66 not ok 1 - this is that
67 # Failed test 'this is that'
73 # Failed test at t/is.c line 8.
78 not ok 6 - null is this
79 # Failed test 'null is this'
83 not ok 7 - this is null
84 # Failed test 'this is null'
89 # Failed test at t/is.c line 13.
97 ok 10 - this isnt that
98 not ok 11 - this isnt this
99 # Failed test 'this isnt this'
102 # expected: anything else
105 # Failed test at t/is.c line 18.
107 # expected: anything else
108 not ok 14 - null isnt null
109 # Failed test 'null isnt null'
112 # expected: anything else
113 ok 15 - null isnt this
114 ok 16 - this isnt null
117 # Failed test at t/is.c line 23.
121 # expected: anything else
122 # Looks like you failed 9 tests of 18 run.
125 cmd_eq_or_diff "t/like", <<END;
127 ok 1 - strange ~~ /range/
128 ok 2 - strange !~~ /anger/
129 ok 3 - matches the regex
132 cmd_eq_or_diff "t/notediag", <<END;
139 cmd_eq_or_diff "t/simple", <<END;
145 # Failed test at t/simple.c line 9.
154 not ok 13 - frobnicate
155 # Failed test 'frobnicate'
156 # at t/simple.c line 18.
166 # Failed test at t/simple.c line 27.
170 # at t/simple.c line 29.
171 # Looks like you failed 4 tests of 24 run.
174 cmd_eq_or_diff "t/skip", <<END;
179 ok 4 # skip need to be on windows
186 cmd_eq_or_diff "t/synopsis", <<END;
189 not ok 2 - two different strings not that way?
190 # Failed test 'two different strings not that way?'
191 # at t/synopsis.c line 7.
197 # Failed test at t/synopsis.c line 10.
201 # Looks like you failed 2 tests of 5 run.
204 cmd_eq_or_diff "t/todo", <<END;
206 not ok 1 - foo # TODO
207 # Failed (TODO) test 'foo'
208 # at t/todo.c line 7.
211 not ok 4 - quux # TODO im not ready
212 # Failed (TODO) test 'quux'
213 # at t/todo.c line 12.
214 ok 5 - thud # TODO im not ready
215 ok 6 - wombat # TODO im not ready