Debian lenny version packages
[pkg-perl] / deb-src / libtest-harness-perl / libtest-harness-perl-3.12 / t / regression.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if ( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = '../lib';
7     }
8     else {
9         push @INC, 't/lib';
10     }
11 }
12
13 use strict;
14
15 use Test::More 'no_plan';
16
17 use File::Spec;
18 use Config;
19
20 use constant TRUE  => "__TRUE__";
21 use constant FALSE => "__FALSE__";
22
23 # if wait() is non-zero, we cannot reliably predict its value
24 use constant NOT_ZERO => "__NOT_ZERO__";
25
26 use TAP::Parser;
27
28 my $IsVMS   = $^O eq 'VMS';
29 my $IsWin32 = $^O eq 'MSWin32';
30
31 my $SAMPLE_TESTS = File::Spec->catdir(
32     File::Spec->curdir,
33     ( $ENV{PERL_CORE} ? 'lib' : 't' ),
34     'sample-tests'
35 );
36
37 my %deprecated = map { $_ => 1 } qw(
38   TAP::Parser::good_plan
39   TAP::Parser::Result::Plan::passed
40   TAP::Parser::Result::Test::passed
41   TAP::Parser::Result::Test::actual_passed
42   TAP::Parser::Result::passed
43 );
44 $SIG{__WARN__} = sub {
45     if ( $_[0] =~ /is deprecated/ ) {
46         my @caller = caller(1);
47         my $sub    = $caller[3];
48         ok exists $deprecated{$sub},
49           "... we should get a deprecated warning for $sub";
50     }
51     else {
52         CORE::warn @_;
53     }
54 };
55
56 # the %samples keys are the names of test scripts in t/sample-tests
57 my %samples = (
58     descriptive => {
59         results => [
60             {   is_plan       => TRUE,
61                 raw           => '1..5',
62                 tests_planned => 5,
63                 passed        => TRUE,
64                 is_ok         => TRUE,
65             },
66             {   actual_passed => TRUE,
67                 is_actual_ok  => TRUE,
68                 description   => "Interlock activated",
69                 passed        => TRUE,
70                 is_ok         => TRUE,
71                 is_test       => TRUE,
72                 has_skip      => FALSE,
73                 has_todo      => FALSE,
74                 number        => 1,
75                 is_unplanned  => FALSE,
76             },
77             {   actual_passed => TRUE,
78                 is_actual_ok  => TRUE,
79                 passed        => TRUE,
80                 is_ok         => TRUE,
81                 is_test       => TRUE,
82                 has_skip      => FALSE,
83                 has_todo      => FALSE,
84                 number        => 2,
85                 description   => "Megathrusters are go",
86                 is_unplanned  => FALSE,
87             },
88             {   actual_passed => TRUE,
89                 is_actual_ok  => TRUE,
90                 passed        => TRUE,
91                 is_ok         => TRUE,
92                 is_test       => TRUE,
93                 has_skip      => FALSE,
94                 has_todo      => FALSE,
95                 number        => 3,
96                 description   => "Head formed",
97                 is_unplanned  => FALSE,
98             },
99             {   actual_passed => TRUE,
100                 is_actual_ok  => TRUE,
101                 passed        => TRUE,
102                 is_ok         => TRUE,
103                 is_test       => TRUE,
104                 has_skip      => FALSE,
105                 has_todo      => FALSE,
106                 number        => 4,
107                 description   => "Blazing sword formed",
108                 is_unplanned  => FALSE,
109             },
110             {   actual_passed => TRUE,
111                 is_actual_ok  => TRUE,
112                 passed        => TRUE,
113                 is_ok         => TRUE,
114                 is_test       => TRUE,
115                 has_skip      => FALSE,
116                 has_todo      => FALSE,
117                 number        => 5,
118                 description   => "Robeast destroyed",
119                 is_unplanned  => FALSE,
120             }
121         ],
122         plan          => '1..5',
123         passed        => [ 1 .. 5 ],
124         actual_passed => [ 1 .. 5 ],
125         failed        => [],
126         actual_failed => [],
127         todo          => [],
128         todo_passed   => [],
129         skipped       => [],
130         good_plan     => TRUE,
131         is_good_plan  => TRUE,
132         tests_planned => 5,
133         tests_run     => 5,
134         parse_errors  => [],
135         'exit'        => 0,
136         wait          => 0,
137         version       => 12,
138     },
139     descriptive_trailing => {
140         results => [
141             {   actual_passed => TRUE,
142                 is_actual_ok  => TRUE,
143                 description   => "Interlock activated",
144                 passed        => TRUE,
145                 is_ok         => TRUE,
146                 is_test       => TRUE,
147                 has_skip      => FALSE,
148                 has_todo      => FALSE,
149                 number        => 1,
150                 is_unplanned  => FALSE,
151             },
152             {   actual_passed => TRUE,
153                 is_actual_ok  => TRUE,
154                 passed        => TRUE,
155                 is_ok         => TRUE,
156                 is_test       => TRUE,
157                 has_skip      => FALSE,
158                 has_todo      => FALSE,
159                 number        => 2,
160                 description   => "Megathrusters are go",
161                 is_unplanned  => FALSE,
162             },
163             {   actual_passed => TRUE,
164                 is_actual_ok  => TRUE,
165                 passed        => TRUE,
166                 is_ok         => TRUE,
167                 is_test       => TRUE,
168                 has_skip      => FALSE,
169                 has_todo      => FALSE,
170                 number        => 3,
171                 description   => "Head formed",
172                 is_unplanned  => FALSE,
173             },
174             {   actual_passed => TRUE,
175                 is_actual_ok  => TRUE,
176                 passed        => TRUE,
177                 is_ok         => TRUE,
178                 is_test       => TRUE,
179                 has_skip      => FALSE,
180                 has_todo      => FALSE,
181                 number        => 4,
182                 description   => "Blazing sword formed",
183                 is_unplanned  => FALSE,
184             },
185             {   actual_passed => TRUE,
186                 is_actual_ok  => TRUE,
187                 passed        => TRUE,
188                 is_ok         => TRUE,
189                 is_test       => TRUE,
190                 has_skip      => FALSE,
191                 has_todo      => FALSE,
192                 number        => 5,
193                 description   => "Robeast destroyed",
194                 is_unplanned  => FALSE,
195             },
196             {   is_plan       => TRUE,
197                 raw           => '1..5',
198                 tests_planned => 5,
199                 passed        => TRUE,
200                 is_ok         => TRUE,
201             },
202         ],
203         plan          => '1..5',
204         passed        => [ 1 .. 5 ],
205         actual_passed => [ 1 .. 5 ],
206         failed        => [],
207         actual_failed => [],
208         todo          => [],
209         todo_passed   => [],
210         skipped       => [],
211         good_plan     => TRUE,
212         is_good_plan  => TRUE,
213         tests_planned => 5,
214         tests_run     => 5,
215         parse_errors  => [],
216         'exit'        => 0,
217         wait          => 0,
218         version       => 12,
219     },
220     empty => {
221         results       => [],
222         plan          => '',
223         passed        => [],
224         actual_passed => [],
225         failed        => [],
226         actual_failed => [],
227         todo          => [],
228         todo_passed   => [],
229         skipped       => [],
230         good_plan     => FALSE,
231         is_good_plan  => FALSE,
232         tests_planned => undef,
233         tests_run     => 0,
234         parse_errors  => ['No plan found in TAP output'],
235         'exit'        => 0,
236         wait          => 0,
237         version       => 12,
238     },
239     simple => {
240         results => [
241             {   is_plan       => TRUE,
242                 raw           => '1..5',
243                 tests_planned => 5,
244                 passed        => TRUE,
245                 is_ok         => TRUE,
246             },
247             {   actual_passed => TRUE,
248                 is_actual_ok  => TRUE,
249                 passed        => TRUE,
250                 is_ok         => TRUE,
251                 is_test       => TRUE,
252                 has_skip      => FALSE,
253                 has_todo      => FALSE,
254                 number        => 1,
255                 description   => "",
256             },
257             {   actual_passed => TRUE,
258                 is_actual_ok  => TRUE,
259                 passed        => TRUE,
260                 is_ok         => TRUE,
261                 is_test       => TRUE,
262                 has_skip      => FALSE,
263                 has_todo      => FALSE,
264                 number        => 2,
265                 description   => "",
266             },
267             {   actual_passed => TRUE,
268                 is_actual_ok  => TRUE,
269                 passed        => TRUE,
270                 is_ok         => TRUE,
271                 is_test       => TRUE,
272                 has_skip      => FALSE,
273                 has_todo      => FALSE,
274                 number        => 3,
275                 description   => "",
276             },
277             {   actual_passed => TRUE,
278                 is_actual_ok  => TRUE,
279                 passed        => TRUE,
280                 is_ok         => TRUE,
281                 is_test       => TRUE,
282                 has_skip      => FALSE,
283                 has_todo      => FALSE,
284                 number        => 4,
285                 description   => "",
286             },
287             {   actual_passed => TRUE,
288                 is_actual_ok  => TRUE,
289                 passed        => TRUE,
290                 is_ok         => TRUE,
291                 is_test       => TRUE,
292                 has_skip      => FALSE,
293                 has_todo      => FALSE,
294                 number        => 5,
295                 description   => "",
296             },
297         ],
298         plan          => '1..5',
299         passed        => [ 1 .. 5 ],
300         actual_passed => [ 1 .. 5 ],
301         failed        => [],
302         actual_failed => [],
303         todo          => [],
304         todo_passed   => [],
305         skipped       => [],
306         good_plan     => TRUE,
307         is_good_plan  => TRUE,
308         tests_planned => 5,
309         tests_run     => 5,
310         parse_errors  => [],
311         'exit'        => 0,
312         wait          => 0,
313         version       => 12,
314     },
315     space_after_plan => {
316         results => [
317             {   is_plan       => TRUE,
318                 raw           => '1..5 ',
319                 tests_planned => 5,
320                 passed        => TRUE,
321                 is_ok         => TRUE,
322             },
323             {   actual_passed => TRUE,
324                 is_actual_ok  => TRUE,
325                 passed        => TRUE,
326                 is_ok         => TRUE,
327                 is_test       => TRUE,
328                 has_skip      => FALSE,
329                 has_todo      => FALSE,
330                 number        => 1,
331                 description   => "",
332             },
333             {   actual_passed => TRUE,
334                 is_actual_ok  => TRUE,
335                 passed        => TRUE,
336                 is_ok         => TRUE,
337                 is_test       => TRUE,
338                 has_skip      => FALSE,
339                 has_todo      => FALSE,
340                 number        => 2,
341                 description   => "",
342             },
343             {   actual_passed => TRUE,
344                 is_actual_ok  => TRUE,
345                 passed        => TRUE,
346                 is_ok         => TRUE,
347                 is_test       => TRUE,
348                 has_skip      => FALSE,
349                 has_todo      => FALSE,
350                 number        => 3,
351                 description   => "",
352             },
353             {   actual_passed => TRUE,
354                 is_actual_ok  => TRUE,
355                 passed        => TRUE,
356                 is_ok         => TRUE,
357                 is_test       => TRUE,
358                 has_skip      => FALSE,
359                 has_todo      => FALSE,
360                 number        => 4,
361                 description   => "",
362             },
363             {   actual_passed => TRUE,
364                 is_actual_ok  => TRUE,
365                 passed        => TRUE,
366                 is_ok         => TRUE,
367                 is_test       => TRUE,
368                 has_skip      => FALSE,
369                 has_todo      => FALSE,
370                 number        => 5,
371                 description   => "",
372             },
373         ],
374         plan          => '1..5',
375         passed        => [ 1 .. 5 ],
376         actual_passed => [ 1 .. 5 ],
377         failed        => [],
378         actual_failed => [],
379         todo          => [],
380         todo_passed   => [],
381         skipped       => [],
382         good_plan     => TRUE,
383         is_good_plan  => TRUE,
384         tests_planned => 5,
385         tests_run     => 5,
386         parse_errors  => [],
387         'exit'        => 0,
388         wait          => 0,
389         version       => 12,
390     },
391     simple_yaml => {
392         results => [
393             {   is_version => TRUE,
394                 raw        => 'TAP version 13',
395             },
396             {   is_plan       => TRUE,
397                 raw           => '1..5',
398                 tests_planned => 5,
399                 passed        => TRUE,
400                 is_ok         => TRUE,
401             },
402             {   actual_passed => TRUE,
403                 is_actual_ok  => TRUE,
404                 passed        => TRUE,
405                 is_ok         => TRUE,
406                 is_test       => TRUE,
407                 has_skip      => FALSE,
408                 has_todo      => FALSE,
409                 number        => 1,
410                 description   => "",
411             },
412             {   actual_passed => TRUE,
413                 is_actual_ok  => TRUE,
414                 passed        => TRUE,
415                 is_ok         => TRUE,
416                 is_test       => TRUE,
417                 has_skip      => FALSE,
418                 has_todo      => FALSE,
419                 number        => 2,
420                 description   => "",
421             },
422             {   is_yaml => TRUE,
423                 data    => [
424                     { 'fnurk' => 'skib', 'ponk' => 'gleeb' },
425                     { 'bar'   => 'krup', 'foo'  => 'plink' }
426                 ],
427                 raw =>
428                   "  ---\n  -\n    fnurk: skib\n    ponk: gleeb\n  -\n    bar: krup\n    foo: plink\n  ...",
429             },
430             {   actual_passed => TRUE,
431                 is_actual_ok  => TRUE,
432                 passed        => TRUE,
433                 is_ok         => TRUE,
434                 is_test       => TRUE,
435                 has_skip      => FALSE,
436                 has_todo      => FALSE,
437                 number        => 3,
438                 description   => "",
439             },
440             {   actual_passed => TRUE,
441                 is_actual_ok  => TRUE,
442                 passed        => TRUE,
443                 is_ok         => TRUE,
444                 is_test       => TRUE,
445                 has_skip      => FALSE,
446                 has_todo      => FALSE,
447                 number        => 4,
448                 description   => "",
449             },
450             {   is_yaml => TRUE,
451                 data    => {
452                     'got'      => [ '1', 'pong', '4' ],
453                     'expected' => [ '1', '2',    '4' ]
454                 },
455                 raw =>
456                   "  ---\n  expected:\n    - 1\n    - 2\n    - 4\n  got:\n    - 1\n    - pong\n    - 4\n  ...",
457             },
458             {   actual_passed => TRUE,
459                 is_actual_ok  => TRUE,
460                 passed        => TRUE,
461                 is_ok         => TRUE,
462                 is_test       => TRUE,
463                 has_skip      => FALSE,
464                 has_todo      => FALSE,
465                 number        => 5,
466                 description   => "",
467             },
468         ],
469         plan          => '1..5',
470         passed        => [ 1 .. 5 ],
471         actual_passed => [ 1 .. 5 ],
472         failed        => [],
473         actual_failed => [],
474         todo          => [],
475         todo_passed   => [],
476         skipped       => [],
477         good_plan     => TRUE,
478         is_good_plan  => TRUE,
479         tests_planned => 5,
480         tests_run     => 5,
481         parse_errors  => [],
482         'exit'        => 0,
483         wait          => 0,
484         version       => 13,
485     },
486     simple_fail => {
487         results => [
488             {   is_plan       => TRUE,
489                 raw           => '1..5',
490                 tests_planned => 5,
491                 passed        => TRUE,
492                 is_ok         => TRUE,
493             },
494             {   actual_passed => TRUE,
495                 is_actual_ok  => TRUE,
496                 passed        => TRUE,
497                 is_ok         => TRUE,
498                 is_test       => TRUE,
499                 has_skip      => FALSE,
500                 has_todo      => FALSE,
501                 number        => 1,
502                 description   => "",
503             },
504             {   actual_passed => FALSE,
505                 is_actual_ok  => FALSE,
506                 passed        => FALSE,
507                 is_ok         => FALSE,
508                 is_test       => TRUE,
509                 has_skip      => FALSE,
510                 has_todo      => FALSE,
511                 number        => 2,
512                 description   => "",
513             },
514             {   actual_passed => TRUE,
515                 is_actual_ok  => TRUE,
516                 passed        => TRUE,
517                 is_ok         => TRUE,
518                 is_test       => TRUE,
519                 has_skip      => FALSE,
520                 has_todo      => FALSE,
521                 number        => 3,
522                 description   => "",
523             },
524             {   actual_passed => TRUE,
525                 is_actual_ok  => TRUE,
526                 passed        => TRUE,
527                 is_ok         => TRUE,
528                 is_test       => TRUE,
529                 has_skip      => FALSE,
530                 has_todo      => FALSE,
531                 number        => 4,
532                 description   => "",
533             },
534             {   actual_passed => FALSE,
535                 is_actual_ok  => FALSE,
536                 passed        => FALSE,
537                 is_ok         => FALSE,
538                 is_test       => TRUE,
539                 has_skip      => FALSE,
540                 has_todo      => FALSE,
541                 number        => 5,
542                 description   => "",
543             },
544         ],
545         plan          => '1..5',
546         passed        => [ 1, 3, 4 ],
547         actual_passed => [ 1, 3, 4 ],
548         failed        => [ 2, 5 ],
549         actual_failed => [ 2, 5 ],
550         todo          => [],
551         todo_passed   => [],
552         skipped       => [],
553         good_plan     => TRUE,
554         is_good_plan  => TRUE,
555         tests_planned => 5,
556         tests_run     => 5,
557         parse_errors  => [],
558         'exit'        => 0,
559         wait          => 0,
560         version       => 12,
561     },
562     skip => {
563         results => [
564             {   is_plan       => TRUE,
565                 raw           => '1..5',
566                 tests_planned => 5,
567                 passed        => TRUE,
568                 is_ok         => TRUE,
569             },
570             {   actual_passed => TRUE,
571                 is_actual_ok  => TRUE,
572                 passed        => TRUE,
573                 is_ok         => TRUE,
574                 is_test       => TRUE,
575                 has_skip      => FALSE,
576                 has_todo      => FALSE,
577                 number        => 1,
578                 description   => "",
579             },
580             {   actual_passed => TRUE,
581                 is_actual_ok  => TRUE,
582                 passed        => TRUE,
583                 is_ok         => TRUE,
584                 is_test       => TRUE,
585                 has_skip      => TRUE,
586                 has_todo      => FALSE,
587                 number        => 2,
588                 description   => "",
589                 explanation   => 'rain delay',
590             },
591             {   actual_passed => TRUE,
592                 is_actual_ok  => TRUE,
593                 passed        => TRUE,
594                 is_ok         => TRUE,
595                 is_test       => TRUE,
596                 has_skip      => FALSE,
597                 has_todo      => FALSE,
598                 number        => 3,
599                 description   => "",
600             },
601             {   actual_passed => TRUE,
602                 is_actual_ok  => TRUE,
603                 passed        => TRUE,
604                 is_ok         => TRUE,
605                 is_test       => TRUE,
606                 has_skip      => FALSE,
607                 has_todo      => FALSE,
608                 number        => 4,
609                 description   => "",
610             },
611             {   actual_passed => TRUE,
612                 is_actual_ok  => TRUE,
613                 passed        => TRUE,
614                 is_ok         => TRUE,
615                 is_test       => TRUE,
616                 has_skip      => FALSE,
617                 has_todo      => FALSE,
618                 number        => 5,
619                 description   => "",
620             },
621         ],
622         plan          => '1..5',
623         passed        => [ 1 .. 5 ],
624         actual_passed => [ 1 .. 5 ],
625         failed        => [],
626         actual_failed => [],
627         todo          => [],
628         todo_passed   => [],
629         skipped       => [2],
630         good_plan     => TRUE,
631         is_good_plan  => TRUE,
632         tests_planned => 5,
633         tests_run     => 5,
634         parse_errors  => [],
635         'exit'        => 0,
636         wait          => 0,
637         version       => 12,
638     },
639     skip_nomsg => {
640         results => [
641             {   is_plan       => TRUE,
642                 passed        => TRUE,
643                 is_ok         => TRUE,
644                 raw           => '1..1',
645                 tests_planned => 1,
646             },
647             {   actual_passed => TRUE,
648                 is_actual_ok  => TRUE,
649                 passed        => TRUE,
650                 is_ok         => TRUE,
651                 is_test       => TRUE,
652                 has_skip      => TRUE,
653                 has_todo      => FALSE,
654                 number        => 1,
655                 description   => "",
656                 explanation   => '',
657             },
658         ],
659         plan          => '1..1',
660         passed        => [1],
661         actual_passed => [1],
662         failed        => [],
663         actual_failed => [],
664         todo          => [],
665         todo_passed   => [],
666         skipped       => [1],
667         good_plan     => TRUE,
668         is_good_plan  => TRUE,
669         tests_planned => 1,
670         tests_run     => TRUE,
671         parse_errors  => [],
672         'exit'        => 0,
673         wait          => 0,
674         version       => 12,
675     },
676     todo_inline => {
677         results => [
678             {   is_plan       => TRUE,
679                 passed        => TRUE,
680                 is_ok         => TRUE,
681                 raw           => '1..3',
682                 tests_planned => 3,
683             },
684             {   actual_passed => FALSE,
685                 is_actual_ok  => FALSE,
686                 passed        => TRUE,
687                 is_ok         => TRUE,
688                 is_test       => TRUE,
689                 has_skip      => FALSE,
690                 has_todo      => TRUE,
691                 number        => 1,
692                 description   => "- Foo",
693                 explanation   => 'Just testing the todo interface.',
694             },
695             {   actual_passed => TRUE,
696                 is_actual_ok  => TRUE,
697                 passed        => TRUE,
698                 is_ok         => TRUE,
699                 is_test       => TRUE,
700                 has_skip      => FALSE,
701                 has_todo      => TRUE,
702                 number        => 2,
703                 description   => "- Unexpected success",
704                 explanation   => 'Just testing the todo interface.',
705             },
706             {   actual_passed => TRUE,
707                 is_actual_ok  => TRUE,
708                 passed        => TRUE,
709                 is_ok         => TRUE,
710                 is_test       => TRUE,
711                 has_skip      => FALSE,
712                 has_todo      => FALSE,
713                 number        => 3,
714                 description   => "- This is not todo",
715                 explanation   => '',
716             },
717         ],
718         plan   => '1..3',
719         passed => [ 1, 2, 3 ],
720         actual_passed => [ 2, 3 ],
721         failed        => [],
722         actual_failed => [1],
723         todo          => [ 1, 2 ],
724         todo_passed   => [2],
725         skipped       => [],
726         good_plan     => TRUE,
727         is_good_plan  => TRUE,
728         tests_planned => 3,
729         tests_run     => 3,
730         parse_errors  => [],
731         'exit'        => 0,
732         wait          => 0,
733         version       => 12,
734     },
735     todo => {
736         results => [
737             {   is_plan       => TRUE,
738                 passed        => TRUE,
739                 is_ok         => TRUE,
740                 raw           => '1..5 todo 3 2;',
741                 tests_planned => 5,
742                 todo_list     => [ 3, 2 ],
743             },
744             {   actual_passed => TRUE,
745                 is_actual_ok  => TRUE,
746                 passed        => TRUE,
747                 is_ok         => TRUE,
748                 is_test       => TRUE,
749                 has_skip      => FALSE,
750                 has_todo      => FALSE,
751                 number        => 1,
752                 description   => "",
753                 explanation   => '',
754             },
755             {   actual_passed => TRUE,
756                 is_actual_ok  => TRUE,
757                 passed        => TRUE,
758                 is_ok         => TRUE,
759                 is_test       => TRUE,
760                 has_skip      => FALSE,
761                 has_todo      => TRUE,
762                 number        => 2,
763                 description   => "",
764                 explanation   => '',
765             },
766             {   actual_passed => FALSE,
767                 is_actual_ok  => FALSE,
768                 passed        => TRUE,
769                 is_ok         => TRUE,
770                 is_test       => TRUE,
771                 has_skip      => FALSE,
772                 has_todo      => TRUE,
773                 number        => 3,
774                 description   => "",
775                 explanation   => '',
776             },
777             {   actual_passed => TRUE,
778                 is_actual_ok  => TRUE,
779                 passed        => TRUE,
780                 is_ok         => TRUE,
781                 is_test       => TRUE,
782                 has_skip      => FALSE,
783                 has_todo      => FALSE,
784                 number        => 4,
785                 description   => "",
786                 explanation   => '',
787             },
788             {   actual_passed => TRUE,
789                 is_actual_ok  => TRUE,
790                 passed        => TRUE,
791                 is_ok         => TRUE,
792                 is_test       => TRUE,
793                 has_skip      => FALSE,
794                 has_todo      => FALSE,
795                 number        => 5,
796                 description   => "",
797                 explanation   => '',
798             },
799         ],
800         plan   => '1..5',
801         passed => [ 1, 2, 3, 4, 5 ],
802         actual_passed => [ 1, 2, 4, 5 ],
803         failed        => [],
804         actual_failed => [3],
805         todo          => [ 2, 3 ],
806         todo_passed   => [2],
807         skipped       => [],
808         good_plan     => TRUE,
809         is_good_plan  => TRUE,
810         tests_planned => 5,
811         tests_run     => 5,
812         parse_errors  => [],
813         'exit'        => 0,
814         wait          => 0,
815         version       => 12,
816     },
817     duplicates => {
818         results => [
819             {   is_plan       => TRUE,
820                 passed        => TRUE,
821                 is_ok         => TRUE,
822                 raw           => '1..10',
823                 tests_planned => 10,
824             },
825             {   actual_passed => TRUE,
826                 is_actual_ok  => TRUE,
827                 passed        => TRUE,
828                 is_ok         => TRUE,
829                 is_test       => TRUE,
830                 has_skip      => FALSE,
831                 has_todo      => FALSE,
832                 number        => 1,
833                 description   => '',
834                 explanation   => '',
835                 is_unplanned  => FALSE,
836             },
837             {   actual_passed => TRUE,
838                 is_actual_ok  => TRUE,
839                 passed        => TRUE,
840                 is_ok         => TRUE,
841                 is_test       => TRUE,
842                 has_skip      => FALSE,
843                 has_todo      => FALSE,
844                 number        => 2,
845                 description   => '',
846                 explanation   => '',
847                 is_unplanned  => FALSE,
848             },
849             {   actual_passed => TRUE,
850                 is_actual_ok  => TRUE,
851                 passed        => TRUE,
852                 is_ok         => TRUE,
853                 is_test       => TRUE,
854                 has_skip      => FALSE,
855                 has_todo      => FALSE,
856                 number        => 3,
857                 description   => '',
858                 explanation   => '',
859                 is_unplanned  => FALSE,
860             },
861             {   actual_passed => TRUE,
862                 is_actual_ok  => TRUE,
863                 passed        => TRUE,
864                 is_ok         => TRUE,
865                 is_test       => TRUE,
866                 has_skip      => FALSE,
867                 has_todo      => FALSE,
868                 number        => 4,
869                 description   => '',
870                 explanation   => '',
871                 is_unplanned  => FALSE,
872             },
873             {   actual_passed => TRUE,
874                 is_actual_ok  => TRUE,
875                 passed        => TRUE,
876                 is_ok         => TRUE,
877                 is_test       => TRUE,
878                 has_skip      => FALSE,
879                 has_todo      => FALSE,
880                 number        => 4,
881                 description   => '',
882                 explanation   => '',
883                 is_unplanned  => FALSE,
884             },
885             {   actual_passed => TRUE,
886                 is_actual_ok  => TRUE,
887                 passed        => TRUE,
888                 is_ok         => TRUE,
889                 is_test       => TRUE,
890                 has_skip      => FALSE,
891                 has_todo      => FALSE,
892                 number        => 5,
893                 description   => '',
894                 explanation   => '',
895                 is_unplanned  => FALSE,
896             },
897             {   actual_passed => TRUE,
898                 is_actual_ok  => TRUE,
899                 passed        => TRUE,
900                 is_ok         => TRUE,
901                 is_test       => TRUE,
902                 has_skip      => FALSE,
903                 has_todo      => FALSE,
904                 number        => 6,
905                 description   => '',
906                 explanation   => '',
907                 is_unplanned  => FALSE,
908             },
909             {   actual_passed => TRUE,
910                 is_actual_ok  => TRUE,
911                 passed        => TRUE,
912                 is_ok         => TRUE,
913                 is_test       => TRUE,
914                 has_skip      => FALSE,
915                 has_todo      => FALSE,
916                 number        => 7,
917                 description   => '',
918                 explanation   => '',
919                 is_unplanned  => FALSE,
920             },
921             {   actual_passed => TRUE,
922                 is_actual_ok  => TRUE,
923                 passed        => TRUE,
924                 is_ok         => TRUE,
925                 is_test       => TRUE,
926                 has_skip      => FALSE,
927                 has_todo      => FALSE,
928                 number        => 8,
929                 description   => '',
930                 explanation   => '',
931                 is_unplanned  => FALSE,
932             },
933             {   actual_passed => TRUE,
934                 is_actual_ok  => TRUE,
935                 passed        => TRUE,
936                 is_ok         => TRUE,
937                 is_test       => TRUE,
938                 has_skip      => FALSE,
939                 has_todo      => FALSE,
940                 number        => 9,
941                 description   => '',
942                 explanation   => '',
943                 is_unplanned  => FALSE,
944             },
945             {   actual_passed => TRUE,
946                 is_actual_ok  => TRUE,
947                 passed        => FALSE,
948                 is_ok         => FALSE,
949                 is_test       => TRUE,
950                 has_skip      => FALSE,
951                 has_todo      => FALSE,
952                 number        => 10,
953                 description   => '',
954                 explanation   => '',
955                 is_unplanned  => TRUE,
956             },
957         ],
958         plan          => '1..10',
959         passed        => [ 1 .. 4, 4 .. 9 ],
960         actual_passed => [ 1 .. 4, 4 .. 10 ],
961         failed        => [10],
962         actual_failed => [],
963         todo          => [],
964         todo_passed   => [],
965         skipped       => [],
966         good_plan     => FALSE,
967         tests_planned => 10,
968         tests_run     => 11,
969         parse_errors  => [
970             'Tests out of sequence.  Found (4) but expected (5)',
971             'Tests out of sequence.  Found (5) but expected (6)',
972             'Tests out of sequence.  Found (6) but expected (7)',
973             'Tests out of sequence.  Found (7) but expected (8)',
974             'Tests out of sequence.  Found (8) but expected (9)',
975             'Tests out of sequence.  Found (9) but expected (10)',
976             'Tests out of sequence.  Found (10) but expected (11)',
977             'Bad plan.  You planned 10 tests but ran 11.',
978         ],
979         'exit' => 0,
980         wait   => 0,
981     },
982     no_nums => {
983         results => [
984             {   is_plan       => TRUE,
985                 passed        => TRUE,
986                 is_ok         => TRUE,
987                 raw           => '1..5',
988                 tests_planned => 5,
989             },
990             {   actual_passed => TRUE,
991                 is_actual_ok  => TRUE,
992                 description   => "",
993                 passed        => TRUE,
994                 is_ok         => TRUE,
995                 is_test       => TRUE,
996                 has_skip      => FALSE,
997                 has_todo      => FALSE,
998                 number        => 1,
999             },
1000             {   actual_passed => TRUE,
1001                 is_actual_ok  => TRUE,
1002                 passed        => TRUE,
1003                 is_ok         => TRUE,
1004                 is_test       => TRUE,
1005                 has_skip      => FALSE,
1006                 has_todo      => FALSE,
1007                 number        => 2,
1008                 description   => "",
1009             },
1010             {   actual_passed => FALSE,
1011                 is_actual_ok  => FALSE,
1012                 passed        => FALSE,
1013                 is_ok         => FALSE,
1014                 is_test       => TRUE,
1015                 has_skip      => FALSE,
1016                 has_todo      => FALSE,
1017                 number        => 3,
1018                 description   => "",
1019             },
1020             {   actual_passed => TRUE,
1021                 is_actual_ok  => TRUE,
1022                 passed        => TRUE,
1023                 is_ok         => TRUE,
1024                 is_test       => TRUE,
1025                 has_skip      => FALSE,
1026                 has_todo      => FALSE,
1027                 number        => 4,
1028                 description   => "",
1029             },
1030             {   actual_passed => TRUE,
1031                 is_actual_ok  => TRUE,
1032                 passed        => TRUE,
1033                 is_ok         => TRUE,
1034                 is_test       => TRUE,
1035                 has_skip      => FALSE,
1036                 has_todo      => FALSE,
1037                 number        => 5,
1038                 description   => "",
1039             }
1040         ],
1041         plan          => '1..5',
1042         passed        => [ 1, 2, 4, 5 ],
1043         actual_passed => [ 1, 2, 4, 5 ],
1044         failed        => [3],
1045         actual_failed => [3],
1046         todo          => [],
1047         todo_passed   => [],
1048         skipped       => [],
1049         good_plan     => TRUE,
1050         is_good_plan  => TRUE,
1051         tests_planned => 5,
1052         tests_run     => 5,
1053         parse_errors  => [],
1054         'exit'        => 0,
1055         wait          => 0,
1056         version       => 12,
1057     },
1058     bailout => {
1059         results => [
1060             {   is_plan       => TRUE,
1061                 passed        => TRUE,
1062                 is_ok         => TRUE,
1063                 raw           => '1..5',
1064                 tests_planned => 5,
1065             },
1066             {   actual_passed => TRUE,
1067                 is_actual_ok  => TRUE,
1068                 description   => "",
1069                 passed        => TRUE,
1070                 is_ok         => TRUE,
1071                 is_test       => TRUE,
1072                 has_skip      => FALSE,
1073                 has_todo      => FALSE,
1074                 number        => 1,
1075             },
1076             {   actual_passed => TRUE,
1077                 is_actual_ok  => TRUE,
1078                 passed        => TRUE,
1079                 is_ok         => TRUE,
1080                 is_test       => TRUE,
1081                 has_skip      => FALSE,
1082                 has_todo      => FALSE,
1083                 number        => 2,
1084                 description   => "",
1085             },
1086             {   actual_passed => TRUE,
1087                 is_actual_ok  => TRUE,
1088                 passed        => TRUE,
1089                 is_ok         => TRUE,
1090                 is_test       => TRUE,
1091                 has_skip      => FALSE,
1092                 has_todo      => FALSE,
1093                 number        => 3,
1094                 description   => "",
1095             },
1096             {   is_bailout  => TRUE,
1097                 explanation => "GERONIMMMOOOOOO!!!",
1098             },
1099             {   actual_passed => TRUE,
1100                 is_actual_ok  => TRUE,
1101                 passed        => TRUE,
1102                 is_ok         => TRUE,
1103                 is_test       => TRUE,
1104                 has_skip      => FALSE,
1105                 has_todo      => FALSE,
1106                 number        => 4,
1107                 description   => "",
1108             },
1109             {   actual_passed => TRUE,
1110                 is_actual_ok  => TRUE,
1111                 passed        => TRUE,
1112                 is_ok         => TRUE,
1113                 is_test       => TRUE,
1114                 has_skip      => FALSE,
1115                 has_todo      => FALSE,
1116                 number        => 5,
1117                 description   => "",
1118             }
1119         ],
1120         plan          => '1..5',
1121         passed        => [ 1 .. 5 ],
1122         actual_passed => [ 1 .. 5 ],
1123         failed        => [],
1124         actual_failed => [],
1125         todo          => [],
1126         todo_passed   => [],
1127         skipped       => [],
1128         good_plan     => TRUE,
1129         is_good_plan  => TRUE,
1130         tests_planned => 5,
1131         tests_run     => 5,
1132         parse_errors  => [],
1133         'exit'        => 0,
1134         wait          => 0,
1135         version       => 12,
1136     },
1137     no_output => {
1138         results       => [],
1139         plan          => '',
1140         passed        => [],
1141         actual_passed => [],
1142         failed        => [],
1143         actual_failed => [],
1144         todo          => [],
1145         todo_passed   => [],
1146         skipped       => [],
1147         good_plan     => FALSE,
1148         tests_planned => undef,
1149         tests_run     => 0,
1150         parse_errors  => [ 'No plan found in TAP output', ],
1151         'exit'        => 0,
1152         wait          => 0,
1153     },
1154     too_many => {
1155         results => [
1156             {   is_plan       => TRUE,
1157                 passed        => TRUE,
1158                 is_ok         => TRUE,
1159                 raw           => '1..3',
1160                 tests_planned => 3,
1161             },
1162             {   actual_passed => TRUE,
1163                 is_actual_ok  => TRUE,
1164                 description   => "",
1165                 passed        => TRUE,
1166                 is_ok         => TRUE,
1167                 is_test       => TRUE,
1168                 has_skip      => FALSE,
1169                 has_todo      => FALSE,
1170                 number        => 1,
1171                 is_unplanned  => FALSE,
1172             },
1173             {   actual_passed => TRUE,
1174                 is_actual_ok  => TRUE,
1175                 passed        => TRUE,
1176                 is_ok         => TRUE,
1177                 is_test       => TRUE,
1178                 has_skip      => FALSE,
1179                 has_todo      => FALSE,
1180                 number        => 2,
1181                 description   => "",
1182                 is_unplanned  => FALSE,
1183             },
1184             {   actual_passed => TRUE,
1185                 is_actual_ok  => TRUE,
1186                 passed        => TRUE,
1187                 is_ok         => TRUE,
1188                 is_test       => TRUE,
1189                 has_skip      => FALSE,
1190                 has_todo      => FALSE,
1191                 number        => 3,
1192                 description   => "",
1193                 is_unplanned  => FALSE,
1194             },
1195             {   actual_passed => TRUE,
1196                 is_actual_ok  => TRUE,
1197                 passed        => FALSE,
1198                 is_ok         => FALSE,
1199                 is_test       => TRUE,
1200                 has_skip      => FALSE,
1201                 has_todo      => FALSE,
1202                 number        => 4,
1203                 description   => "",
1204                 is_unplanned  => TRUE,
1205             },
1206             {   actual_passed => TRUE,
1207                 is_actual_ok  => TRUE,
1208                 passed        => FALSE,
1209                 is_ok         => FALSE,
1210                 is_test       => TRUE,
1211                 has_skip      => FALSE,
1212                 has_todo      => FALSE,
1213                 number        => 5,
1214                 description   => "",
1215                 is_unplanned  => TRUE,
1216             },
1217             {   actual_passed => TRUE,
1218                 is_actual_ok  => TRUE,
1219                 passed        => FALSE,
1220                 is_ok         => FALSE,
1221                 is_test       => TRUE,
1222                 has_skip      => FALSE,
1223                 has_todo      => FALSE,
1224                 number        => 6,
1225                 description   => "",
1226                 is_unplanned  => TRUE,
1227             },
1228             {   actual_passed => TRUE,
1229                 is_actual_ok  => TRUE,
1230                 passed        => FALSE,
1231                 is_ok         => FALSE,
1232                 is_test       => TRUE,
1233                 has_skip      => FALSE,
1234                 has_todo      => FALSE,
1235                 number        => 7,
1236                 description   => "",
1237                 is_unplanned  => TRUE,
1238             },
1239         ],
1240         plan          => '1..3',
1241         passed        => [ 1 .. 3 ],
1242         actual_passed => [ 1 .. 7 ],
1243         failed        => [ 4 .. 7 ],
1244         actual_failed => [],
1245         todo          => [],
1246         todo_passed   => [],
1247         skipped       => [],
1248         good_plan     => FALSE,
1249         tests_planned => 3,
1250         tests_run     => 7,
1251         parse_errors  => ['Bad plan.  You planned 3 tests but ran 7.'],
1252         'exit'        => 4,
1253         wait          => NOT_ZERO,
1254         skip_if       => sub {$IsVMS},
1255     },
1256     taint => {
1257         results => [
1258             {   is_plan       => TRUE,
1259                 passed        => TRUE,
1260                 is_ok         => TRUE,
1261                 raw           => '1..1',
1262                 tests_planned => TRUE,
1263             },
1264             {   actual_passed => TRUE,
1265                 is_actual_ok  => TRUE,
1266                 description   => "- -T honored",
1267                 passed        => TRUE,
1268                 is_ok         => TRUE,
1269                 is_test       => TRUE,
1270                 has_skip      => FALSE,
1271                 has_todo      => FALSE,
1272                 number        => 1,
1273             },
1274         ],
1275         plan          => '1..1',
1276         passed        => [ 1 .. 1 ],
1277         actual_passed => [ 1 .. 1 ],
1278         failed        => [],
1279         actual_failed => [],
1280         todo          => [],
1281         todo_passed   => [],
1282         skipped       => [],
1283         good_plan     => TRUE,
1284         is_good_plan  => TRUE,
1285         tests_planned => TRUE,
1286         tests_run     => TRUE,
1287         parse_errors  => [],
1288         'exit'        => 0,
1289         wait          => 0,
1290         version       => 12,
1291     },
1292     'die' => {
1293         results       => [],
1294         plan          => '',
1295         passed        => [],
1296         actual_passed => [],
1297         failed        => [],
1298         actual_failed => [],
1299         todo          => [],
1300         todo_passed   => [],
1301         skipped       => [],
1302         good_plan     => FALSE,
1303         tests_planned => undef,
1304         tests_run     => 0,
1305         parse_errors  => [ 'No plan found in TAP output', ],
1306         'exit'        => NOT_ZERO,
1307         wait          => NOT_ZERO,
1308     },
1309     die_head_end => {
1310         results => [
1311             {   actual_passed => TRUE,
1312                 is_actual_ok  => TRUE,
1313                 passed        => TRUE,
1314                 is_ok         => TRUE,
1315                 is_test       => TRUE,
1316                 has_skip      => FALSE,
1317                 has_todo      => FALSE,
1318                 number        => 1,
1319                 description   => '',
1320                 explanation   => '',
1321             },
1322             {   actual_passed => TRUE,
1323                 is_actual_ok  => TRUE,
1324                 passed        => TRUE,
1325                 is_ok         => TRUE,
1326                 is_test       => TRUE,
1327                 has_skip      => FALSE,
1328                 has_todo      => FALSE,
1329                 number        => 2,
1330                 description   => '',
1331                 explanation   => '',
1332             },
1333             {   actual_passed => TRUE,
1334                 is_actual_ok  => TRUE,
1335                 passed        => TRUE,
1336                 is_ok         => TRUE,
1337                 is_test       => TRUE,
1338                 has_skip      => FALSE,
1339                 has_todo      => FALSE,
1340                 number        => 3,
1341                 description   => '',
1342                 explanation   => '',
1343             },
1344             {   actual_passed => TRUE,
1345                 is_actual_ok  => TRUE,
1346                 passed        => TRUE,
1347                 is_ok         => TRUE,
1348                 is_test       => TRUE,
1349                 has_skip      => FALSE,
1350                 has_todo      => FALSE,
1351                 number        => 4,
1352                 description   => '',
1353                 explanation   => '',
1354             },
1355         ],
1356         plan          => '',
1357         passed        => [ 1 .. 4 ],
1358         actual_passed => [ 1 .. 4 ],
1359         failed        => [],
1360         actual_failed => [],
1361         todo          => [],
1362         todo_passed   => [],
1363         skipped       => [],
1364         good_plan     => FALSE,
1365         tests_planned => undef,
1366         tests_run     => 4,
1367         parse_errors  => [ 'No plan found in TAP output', ],
1368         'exit'        => NOT_ZERO,
1369         wait          => NOT_ZERO,
1370     },
1371     die_last_minute => {
1372         results => [
1373             {   actual_passed => TRUE,
1374                 is_actual_ok  => TRUE,
1375                 passed        => TRUE,
1376                 is_ok         => TRUE,
1377                 is_test       => TRUE,
1378                 has_skip      => FALSE,
1379                 has_todo      => FALSE,
1380                 number        => 1,
1381                 description   => '',
1382                 explanation   => '',
1383             },
1384             {   actual_passed => TRUE,
1385                 is_actual_ok  => TRUE,
1386                 passed        => TRUE,
1387                 is_ok         => TRUE,
1388                 is_test       => TRUE,
1389                 has_skip      => FALSE,
1390                 has_todo      => FALSE,
1391                 number        => 2,
1392                 description   => '',
1393                 explanation   => '',
1394             },
1395             {   actual_passed => TRUE,
1396                 is_actual_ok  => TRUE,
1397                 passed        => TRUE,
1398                 is_ok         => TRUE,
1399                 is_test       => TRUE,
1400                 has_skip      => FALSE,
1401                 has_todo      => FALSE,
1402                 number        => 3,
1403                 description   => '',
1404                 explanation   => '',
1405             },
1406             {   actual_passed => TRUE,
1407                 is_actual_ok  => TRUE,
1408                 passed        => TRUE,
1409                 is_ok         => TRUE,
1410                 is_test       => TRUE,
1411                 has_skip      => FALSE,
1412                 has_todo      => FALSE,
1413                 number        => 4,
1414                 description   => '',
1415                 explanation   => '',
1416             },
1417             {   is_plan       => TRUE,
1418                 passed        => TRUE,
1419                 is_ok         => TRUE,
1420                 raw           => '1..4',
1421                 tests_planned => 4,
1422             },
1423         ],
1424         plan          => '1..4',
1425         passed        => [ 1 .. 4 ],
1426         actual_passed => [ 1 .. 4 ],
1427         failed        => [],
1428         actual_failed => [],
1429         todo          => [],
1430         todo_passed   => [],
1431         skipped       => [],
1432         good_plan     => TRUE,
1433         is_good_plan  => TRUE,
1434         tests_planned => 4,
1435         tests_run     => 4,
1436         parse_errors  => [],
1437         'exit'        => NOT_ZERO,
1438         wait          => NOT_ZERO,
1439     },
1440     bignum => {
1441         results => [
1442             {   is_plan       => TRUE,
1443                 passed        => TRUE,
1444                 is_ok         => TRUE,
1445                 raw           => '1..2',
1446                 tests_planned => 2,
1447             },
1448             {   actual_passed => TRUE,
1449                 is_actual_ok  => TRUE,
1450                 passed        => TRUE,
1451                 is_ok         => TRUE,
1452                 is_test       => TRUE,
1453                 has_skip      => FALSE,
1454                 has_todo      => FALSE,
1455                 number        => 1,
1456                 description   => '',
1457                 explanation   => '',
1458             },
1459             {   actual_passed => TRUE,
1460                 is_actual_ok  => TRUE,
1461                 passed        => TRUE,
1462                 is_ok         => TRUE,
1463                 is_test       => TRUE,
1464                 has_skip      => FALSE,
1465                 has_todo      => FALSE,
1466                 number        => 2,
1467                 description   => '',
1468                 explanation   => '',
1469             },
1470             {   actual_passed => TRUE,
1471                 is_actual_ok  => TRUE,
1472                 passed        => FALSE,
1473                 is_ok         => FALSE,
1474                 is_test       => TRUE,
1475                 has_skip      => FALSE,
1476                 has_todo      => FALSE,
1477                 number        => 136211425,
1478                 description   => '',
1479                 explanation   => '',
1480             },
1481             {   actual_passed => TRUE,
1482                 is_actual_ok  => TRUE,
1483                 passed        => FALSE,
1484                 is_ok         => FALSE,
1485                 is_test       => TRUE,
1486                 has_skip      => FALSE,
1487                 has_todo      => FALSE,
1488                 number        => 136211426,
1489                 description   => '',
1490                 explanation   => '',
1491             },
1492         ],
1493         plan          => '1..2',
1494         passed        => [ 1, 2 ],
1495         actual_passed => [ 1, 2, 136211425, 136211426 ],
1496         failed        => [ 136211425, 136211426 ],
1497         actual_failed => [],
1498         todo          => [],
1499         todo_passed   => [],
1500         skipped       => [],
1501         good_plan     => FALSE,
1502         tests_planned => 2,
1503         tests_run     => 4,
1504         parse_errors  => [
1505             'Tests out of sequence.  Found (136211425) but expected (3)',
1506             'Tests out of sequence.  Found (136211426) but expected (4)',
1507             'Bad plan.  You planned 2 tests but ran 4.'
1508         ],
1509         'exit' => 0,
1510         wait   => 0,
1511     },
1512     bignum_many => {
1513         results => [
1514             {   is_plan       => TRUE,
1515                 passed        => TRUE,
1516                 is_ok         => TRUE,
1517                 raw           => '1..2',
1518                 tests_planned => 2,
1519             },
1520             {   actual_passed => TRUE,
1521                 is_actual_ok  => TRUE,
1522                 passed        => TRUE,
1523                 is_ok         => TRUE,
1524                 is_test       => TRUE,
1525                 has_skip      => FALSE,
1526                 has_todo      => FALSE,
1527                 number        => 1,
1528                 description   => '',
1529                 explanation   => '',
1530             },
1531             {   actual_passed => TRUE,
1532                 is_actual_ok  => TRUE,
1533                 passed        => TRUE,
1534                 is_ok         => TRUE,
1535                 is_test       => TRUE,
1536                 has_skip      => FALSE,
1537                 has_todo      => FALSE,
1538                 number        => 2,
1539                 description   => '',
1540                 explanation   => '',
1541             },
1542             {   actual_passed => TRUE,
1543                 is_actual_ok  => TRUE,
1544                 passed        => FALSE,
1545                 is_ok         => FALSE,
1546                 is_test       => TRUE,
1547                 has_skip      => FALSE,
1548                 has_todo      => FALSE,
1549                 number        => 99997,
1550                 description   => '',
1551                 explanation   => '',
1552             },
1553             {   actual_passed => TRUE,
1554                 is_actual_ok  => TRUE,
1555                 passed        => FALSE,
1556                 is_ok         => FALSE,
1557                 is_test       => TRUE,
1558                 has_skip      => FALSE,
1559                 has_todo      => FALSE,
1560                 number        => 99998,
1561                 description   => '',
1562                 explanation   => '',
1563             },
1564             {   actual_passed => TRUE,
1565                 is_actual_ok  => TRUE,
1566                 passed        => FALSE,
1567                 is_ok         => FALSE,
1568                 is_test       => TRUE,
1569                 has_skip      => FALSE,
1570                 has_todo      => FALSE,
1571                 number        => 99999,
1572                 description   => '',
1573                 explanation   => '',
1574             },
1575             {   actual_passed => TRUE,
1576                 is_actual_ok  => TRUE,
1577                 passed        => FALSE,
1578                 is_ok         => FALSE,
1579                 is_test       => TRUE,
1580                 has_skip      => FALSE,
1581                 has_todo      => FALSE,
1582                 number        => 100000,
1583                 description   => '',
1584                 explanation   => '',
1585             },
1586             {   actual_passed => TRUE,
1587                 is_actual_ok  => TRUE,
1588                 passed        => FALSE,
1589                 is_ok         => FALSE,
1590                 is_test       => TRUE,
1591                 has_skip      => FALSE,
1592                 has_todo      => FALSE,
1593                 number        => 100001,
1594                 description   => '',
1595                 explanation   => '',
1596             },
1597             {   actual_passed => TRUE,
1598                 is_actual_ok  => TRUE,
1599                 passed        => FALSE,
1600                 is_ok         => FALSE,
1601                 is_test       => TRUE,
1602                 has_skip      => FALSE,
1603                 has_todo      => FALSE,
1604                 number        => 100002,
1605                 description   => '',
1606                 explanation   => '',
1607             },
1608             {   actual_passed => TRUE,
1609                 is_actual_ok  => TRUE,
1610                 passed        => FALSE,
1611                 is_ok         => FALSE,
1612                 is_test       => TRUE,
1613                 has_skip      => FALSE,
1614                 has_todo      => FALSE,
1615                 number        => 100003,
1616                 description   => '',
1617                 explanation   => '',
1618             },
1619             {   actual_passed => TRUE,
1620                 is_actual_ok  => TRUE,
1621                 passed        => FALSE,
1622                 is_ok         => FALSE,
1623                 is_test       => TRUE,
1624                 has_skip      => FALSE,
1625                 has_todo      => FALSE,
1626                 number        => 100004,
1627                 description   => '',
1628                 explanation   => '',
1629             },
1630             {   actual_passed => TRUE,
1631                 is_actual_ok  => TRUE,
1632                 passed        => FALSE,
1633                 is_ok         => FALSE,
1634                 is_test       => TRUE,
1635                 has_skip      => FALSE,
1636                 has_todo      => FALSE,
1637                 number        => 100005,
1638                 description   => '',
1639                 explanation   => '',
1640             },
1641         ],
1642         plan          => '1..2',
1643         passed        => [ 1, 2 ],
1644         actual_passed => [ 1, 2, 99997 .. 100005 ],
1645         failed        => [ 99997 .. 100005 ],
1646         actual_failed => [],
1647         todo          => [],
1648         todo_passed   => [],
1649         skipped       => [],
1650         good_plan     => FALSE,
1651         tests_planned => 2,
1652         tests_run     => 11,
1653         parse_errors  => [
1654             'Tests out of sequence.  Found (99997) but expected (3)',
1655             'Tests out of sequence.  Found (99998) but expected (4)',
1656             'Tests out of sequence.  Found (99999) but expected (5)',
1657             'Tests out of sequence.  Found (100000) but expected (6)',
1658             'Tests out of sequence.  Found (100001) but expected (7)',
1659             'Tests out of sequence.  Found (100002) but expected (8)',
1660             'Tests out of sequence.  Found (100003) but expected (9)',
1661             'Tests out of sequence.  Found (100004) but expected (10)',
1662             'Tests out of sequence.  Found (100005) but expected (11)',
1663             'Bad plan.  You planned 2 tests but ran 11.'
1664         ],
1665         'exit' => 0,
1666         wait   => 0,
1667     },
1668     combined => {
1669         results => [
1670             {   is_plan       => TRUE,
1671                 passed        => TRUE,
1672                 is_ok         => TRUE,
1673                 raw           => '1..10',
1674                 tests_planned => 10,
1675             },
1676             {   actual_passed => TRUE,
1677                 is_actual_ok  => TRUE,
1678                 passed        => TRUE,
1679                 is_ok         => TRUE,
1680                 is_test       => TRUE,
1681                 has_skip      => FALSE,
1682                 has_todo      => FALSE,
1683                 number        => 1,
1684                 description   => '',
1685                 explanation   => '',
1686             },
1687             {   actual_passed => TRUE,
1688                 is_actual_ok  => TRUE,
1689                 passed        => TRUE,
1690                 is_ok         => TRUE,
1691                 is_test       => TRUE,
1692                 has_skip      => FALSE,
1693                 has_todo      => FALSE,
1694                 number        => 2,
1695                 description   => 'basset hounds got long ears',
1696                 explanation   => '',
1697             },
1698             {   actual_passed => FALSE,
1699                 is_actual_ok  => FALSE,
1700                 passed        => FALSE,
1701                 is_ok         => FALSE,
1702                 is_test       => TRUE,
1703                 has_skip      => FALSE,
1704                 has_todo      => FALSE,
1705                 number        => 3,
1706                 description   => 'all hell broke loose',
1707                 explanation   => '',
1708             },
1709             {   actual_passed => FALSE,
1710                 is_actual_ok  => FALSE,
1711                 passed        => TRUE,
1712                 is_ok         => TRUE,
1713                 is_test       => TRUE,
1714                 has_skip      => FALSE,
1715                 has_todo      => TRUE,
1716                 number        => 4,
1717                 description   => '',
1718                 explanation   => 'if I heard a voice from heaven ...',
1719             },
1720             {   actual_passed => TRUE,
1721                 is_actual_ok  => TRUE,
1722                 passed        => TRUE,
1723                 is_ok         => TRUE,
1724                 is_test       => TRUE,
1725                 has_skip      => FALSE,
1726                 has_todo      => FALSE,
1727                 number        => 5,
1728                 description   => 'say "live without loving",',
1729                 explanation   => '',
1730             },
1731             {   actual_passed => TRUE,
1732                 is_actual_ok  => TRUE,
1733                 passed        => TRUE,
1734                 is_ok         => TRUE,
1735                 is_test       => TRUE,
1736                 has_skip      => FALSE,
1737                 has_todo      => FALSE,
1738                 number        => 6,
1739                 description   => "I'd beg off.",
1740                 explanation   => '',
1741             },
1742             {   actual_passed => TRUE,
1743                 is_actual_ok  => TRUE,
1744                 passed        => TRUE,
1745                 is_ok         => TRUE,
1746                 is_test       => TRUE,
1747                 has_skip      => '1',
1748                 has_todo      => FALSE,
1749                 number        => 7,
1750                 description   => '',
1751                 explanation   => 'contract negotiations',
1752             },
1753             {   actual_passed => TRUE,
1754                 is_actual_ok  => TRUE,
1755                 passed        => TRUE,
1756                 is_ok         => TRUE,
1757                 is_test       => TRUE,
1758                 has_skip      => FALSE,
1759                 has_todo      => FALSE,
1760                 number        => 8,
1761                 description   => 'Girls are such exquisite hell',
1762                 explanation   => '',
1763             },
1764             {   actual_passed => TRUE,
1765                 is_actual_ok  => TRUE,
1766                 passed        => TRUE,
1767                 is_ok         => TRUE,
1768                 is_test       => TRUE,
1769                 has_skip      => FALSE,
1770                 has_todo      => TRUE,
1771                 number        => 9,
1772                 description   => 'Elegy 9B',
1773                 explanation   => '',
1774             },
1775             {   actual_passed => FALSE,
1776                 is_actual_ok  => FALSE,
1777                 passed        => FALSE,
1778                 is_ok         => FALSE,
1779                 is_test       => TRUE,
1780                 has_skip      => FALSE,
1781                 has_todo      => FALSE,
1782                 number        => 10,
1783                 description   => '',
1784                 explanation   => '',
1785             },
1786         ],
1787         plan          => '1..10',
1788         passed        => [ 1 .. 2, 4 .. 9 ],
1789         actual_passed => [ 1 .. 2, 5 .. 9 ],
1790         failed        => [ 3, 10 ],
1791         actual_failed => [ 3, 4, 10 ],
1792         todo          => [ 4, 9 ],
1793         todo_passed   => [9],
1794         skipped       => [7],
1795         good_plan     => TRUE,
1796         is_good_plan  => TRUE,
1797         tests_planned => 10,
1798         tests_run     => 10,
1799         parse_errors  => [],
1800         'exit'        => 0,
1801         wait          => 0,
1802         version       => 12,
1803     },
1804     head_end => {
1805         results => [
1806             {   is_comment => TRUE,
1807                 passed     => TRUE,
1808                 is_ok      => TRUE,
1809                 comment    => 'comments',
1810             },
1811             {   actual_passed => TRUE,
1812                 is_actual_ok  => TRUE,
1813                 passed        => TRUE,
1814                 is_ok         => TRUE,
1815                 is_test       => TRUE,
1816                 has_skip      => FALSE,
1817                 has_todo      => FALSE,
1818                 number        => 1,
1819                 description   => '',
1820                 explanation   => '',
1821             },
1822             {   actual_passed => TRUE,
1823                 is_actual_ok  => TRUE,
1824                 passed        => TRUE,
1825                 is_ok         => TRUE,
1826                 is_test       => TRUE,
1827                 has_skip      => FALSE,
1828                 has_todo      => FALSE,
1829                 number        => 2,
1830                 description   => '',
1831                 explanation   => '',
1832             },
1833             {   actual_passed => TRUE,
1834                 is_actual_ok  => TRUE,
1835                 passed        => TRUE,
1836                 is_ok         => TRUE,
1837                 is_test       => TRUE,
1838                 has_skip      => FALSE,
1839                 has_todo      => FALSE,
1840                 number        => 3,
1841                 description   => '',
1842                 explanation   => '',
1843             },
1844             {   actual_passed => TRUE,
1845                 is_actual_ok  => TRUE,
1846                 passed        => TRUE,
1847                 is_ok         => TRUE,
1848                 is_test       => TRUE,
1849                 has_skip      => FALSE,
1850                 has_todo      => FALSE,
1851                 number        => 4,
1852                 description   => '',
1853                 explanation   => '',
1854             },
1855             {   is_comment => TRUE,
1856                 passed     => TRUE,
1857                 is_ok      => TRUE,
1858                 comment    => 'comment',
1859             },
1860             {   is_plan       => TRUE,
1861                 passed        => TRUE,
1862                 is_ok         => TRUE,
1863                 raw           => '1..4',
1864                 tests_planned => 4,
1865             },
1866             {   is_comment => TRUE,
1867                 passed     => TRUE,
1868                 is_ok      => TRUE,
1869                 comment    => 'more ignored stuff',
1870             },
1871             {   is_comment => TRUE,
1872                 passed     => TRUE,
1873                 is_ok      => TRUE,
1874                 comment    => 'and yet more',
1875             },
1876         ],
1877         plan          => '1..4',
1878         passed        => [ 1 .. 4 ],
1879         actual_passed => [ 1 .. 4 ],
1880         failed        => [],
1881         actual_failed => [],
1882         todo          => [],
1883         todo_passed   => [],
1884         skipped       => [],
1885         good_plan     => TRUE,
1886         is_good_plan  => TRUE,
1887         tests_planned => 4,
1888         tests_run     => 4,
1889         parse_errors  => [],
1890         'exit'        => 0,
1891         wait          => 0,
1892         version       => 12,
1893     },
1894     head_fail => {
1895         results => [
1896             {   is_comment => TRUE,
1897                 passed     => TRUE,
1898                 is_ok      => TRUE,
1899                 comment    => 'comments',
1900             },
1901             {   actual_passed => TRUE,
1902                 is_actual_ok  => TRUE,
1903                 passed        => TRUE,
1904                 is_ok         => TRUE,
1905                 is_test       => TRUE,
1906                 has_skip      => FALSE,
1907                 has_todo      => FALSE,
1908                 number        => 1,
1909                 description   => '',
1910                 explanation   => '',
1911             },
1912             {   actual_passed => FALSE,
1913                 is_actual_ok  => FALSE,
1914                 passed        => FALSE,
1915                 is_ok         => FALSE,
1916                 is_test       => TRUE,
1917                 has_skip      => FALSE,
1918                 has_todo      => FALSE,
1919                 number        => 2,
1920                 description   => '',
1921                 explanation   => '',
1922             },
1923             {   actual_passed => TRUE,
1924                 is_actual_ok  => TRUE,
1925                 passed        => TRUE,
1926                 is_ok         => TRUE,
1927                 is_test       => TRUE,
1928                 has_skip      => FALSE,
1929                 has_todo      => FALSE,
1930                 number        => 3,
1931                 description   => '',
1932                 explanation   => '',
1933             },
1934             {   actual_passed => TRUE,
1935                 is_actual_ok  => TRUE,
1936                 passed        => TRUE,
1937                 is_ok         => TRUE,
1938                 is_test       => TRUE,
1939                 has_skip      => FALSE,
1940                 has_todo      => FALSE,
1941                 number        => 4,
1942                 description   => '',
1943                 explanation   => '',
1944             },
1945             {   is_comment => TRUE,
1946                 passed     => TRUE,
1947                 is_ok      => TRUE,
1948                 comment    => 'comment',
1949             },
1950             {   is_plan       => TRUE,
1951                 passed        => TRUE,
1952                 is_ok         => TRUE,
1953                 raw           => '1..4',
1954                 tests_planned => 4,
1955             },
1956             {   is_comment => TRUE,
1957                 passed     => TRUE,
1958                 is_ok      => TRUE,
1959                 comment    => 'more ignored stuff',
1960             },
1961             {   is_comment => TRUE,
1962                 passed     => TRUE,
1963                 is_ok      => TRUE,
1964                 comment    => 'and yet more',
1965             },
1966         ],
1967         plan          => '1..4',
1968         passed        => [ 1, 3, 4 ],
1969         actual_passed => [ 1, 3, 4 ],
1970         failed        => [2],
1971         actual_failed => [2],
1972         todo          => [],
1973         todo_passed   => [],
1974         skipped       => [],
1975         good_plan     => TRUE,
1976         is_good_plan  => TRUE,
1977         tests_planned => 4,
1978         tests_run     => 4,
1979         parse_errors  => [],
1980         'exit'        => 0,
1981         wait          => 0,
1982         version       => 12,
1983     },
1984     out_of_order => {
1985         results => [
1986             {   actual_passed => TRUE,
1987                 is_actual_ok  => TRUE,
1988                 passed        => TRUE,
1989                 is_ok         => TRUE,
1990                 is_test       => TRUE,
1991                 has_skip      => FALSE,
1992                 has_todo      => FALSE,
1993                 number        => 2,
1994                 description   => '- Test that argument passing works',
1995                 explanation   => '',
1996             },
1997             {   actual_passed => TRUE,
1998                 is_actual_ok  => TRUE,
1999                 passed        => TRUE,
2000                 is_ok         => TRUE,
2001                 is_test       => TRUE,
2002                 has_skip      => FALSE,
2003                 has_todo      => FALSE,
2004                 number        => 3,
2005                 description =>
2006                   '- Test that passing arguments as references work',
2007                 explanation => '',
2008             },
2009             {   actual_passed => TRUE,
2010                 is_actual_ok  => TRUE,
2011                 passed        => TRUE,
2012                 is_ok         => TRUE,
2013                 is_test       => TRUE,
2014                 has_skip      => FALSE,
2015                 has_todo      => FALSE,
2016                 number        => 4,
2017                 description   => '- Test a normal sub',
2018                 explanation   => '',
2019             },
2020             {   actual_passed => TRUE,
2021                 is_actual_ok  => TRUE,
2022                 passed        => TRUE,
2023                 is_ok         => TRUE,
2024                 is_test       => TRUE,
2025                 has_skip      => FALSE,
2026                 has_todo      => FALSE,
2027                 number        => 6,
2028                 description   => '- Detach test',
2029                 explanation   => '',
2030             },
2031             {   actual_passed => TRUE,
2032                 is_actual_ok  => TRUE,
2033                 passed        => TRUE,
2034                 is_ok         => TRUE,
2035                 is_test       => TRUE,
2036                 has_skip      => FALSE,
2037                 has_todo      => FALSE,
2038                 number        => 8,
2039                 description   => '- Nested thread test',
2040                 explanation   => '',
2041             },
2042             {   actual_passed => TRUE,
2043                 is_actual_ok  => TRUE,
2044                 passed        => TRUE,
2045                 is_ok         => TRUE,
2046                 is_test       => TRUE,
2047                 has_skip      => FALSE,
2048                 has_todo      => FALSE,
2049                 number        => 9,
2050                 description   => '- Nested thread test',
2051                 explanation   => '',
2052             },
2053             {   actual_passed => TRUE,
2054                 is_actual_ok  => TRUE,
2055                 passed        => TRUE,
2056                 is_ok         => TRUE,
2057                 is_test       => TRUE,
2058                 has_skip      => FALSE,
2059                 has_todo      => FALSE,
2060                 number        => 10,
2061                 description   => '- Wanted 7, got 7',
2062                 explanation   => '',
2063             },
2064             {   actual_passed => TRUE,
2065                 is_actual_ok  => TRUE,
2066                 passed        => TRUE,
2067                 is_ok         => TRUE,
2068                 is_test       => TRUE,
2069                 has_skip      => FALSE,
2070                 has_todo      => FALSE,
2071                 number        => 11,
2072                 description   => '- Wanted 7, got 7',
2073                 explanation   => '',
2074             },
2075             {   actual_passed => TRUE,
2076                 is_actual_ok  => TRUE,
2077                 passed        => TRUE,
2078                 is_ok         => TRUE,
2079                 is_test       => TRUE,
2080                 has_skip      => FALSE,
2081                 has_todo      => FALSE,
2082                 number        => 12,
2083                 description   => '- Wanted 8, got 8',
2084                 explanation   => '',
2085             },
2086             {   actual_passed => TRUE,
2087                 is_actual_ok  => TRUE,
2088                 passed        => TRUE,
2089                 is_ok         => TRUE,
2090                 is_test       => TRUE,
2091                 has_skip      => FALSE,
2092                 has_todo      => FALSE,
2093                 number        => 13,
2094                 description   => '- Wanted 8, got 8',
2095                 explanation   => '',
2096             },
2097             {   is_plan       => TRUE,
2098                 passed        => TRUE,
2099                 is_ok         => TRUE,
2100                 raw           => '1..15',
2101                 tests_planned => 15,
2102             },
2103             {   actual_passed => TRUE,
2104                 is_actual_ok  => TRUE,
2105                 passed        => TRUE,
2106                 is_ok         => TRUE,
2107                 is_test       => TRUE,
2108                 has_skip      => FALSE,
2109                 has_todo      => FALSE,
2110                 number        => 1,
2111                 description   => '',
2112                 explanation   => '',
2113             },
2114             {   actual_passed => TRUE,
2115                 is_actual_ok  => TRUE,
2116                 passed        => TRUE,
2117                 is_ok         => TRUE,
2118                 is_test       => TRUE,
2119                 has_skip      => FALSE,
2120                 has_todo      => FALSE,
2121                 number        => 5,
2122                 description   => '- Check that Config::threads is true',
2123                 explanation   => '',
2124             },
2125             {   actual_passed => TRUE,
2126                 is_actual_ok  => TRUE,
2127                 passed        => TRUE,
2128                 is_ok         => TRUE,
2129                 is_test       => TRUE,
2130                 has_skip      => FALSE,
2131                 has_todo      => FALSE,
2132                 number        => 7,
2133                 description   => '- Detach test',
2134                 explanation   => '',
2135             },
2136             {   actual_passed => TRUE,
2137                 is_actual_ok  => TRUE,
2138                 passed        => TRUE,
2139                 is_ok         => TRUE,
2140                 is_test       => TRUE,
2141                 has_skip      => FALSE,
2142                 has_todo      => FALSE,
2143                 number        => 14,
2144                 description =>
2145                   '- Check so that tid for threads work for main thread',
2146                 explanation => '',
2147             },
2148             {   actual_passed => TRUE,
2149                 is_actual_ok  => TRUE,
2150                 passed        => TRUE,
2151                 is_ok         => TRUE,
2152                 is_test       => TRUE,
2153                 has_skip      => FALSE,
2154                 has_todo      => FALSE,
2155                 number        => 15,
2156                 description =>
2157                   '- Check so that tid for threads work for main thread',
2158                 explanation => '',
2159             },
2160         ],
2161         plan          => '1..15',
2162         passed        => [ 2 .. 4, 6, 8 .. 13, 1, 5, 7, 14, 15 ],
2163         actual_passed => [ 2 .. 4, 6, 8 .. 13, 1, 5, 7, 14, 15 ],
2164         failed        => [],
2165         actual_failed => [],
2166         todo          => [],
2167         todo_passed   => [],
2168         skipped       => [],
2169         is_good_plan  => FALSE,
2170         tests_planned => 15,
2171         tests_run     => 15,
2172
2173         # Note that tests 14 and 15 *are* in the correct sequence.
2174         parse_errors => [
2175             'Tests out of sequence.  Found (2) but expected (1)',
2176             'Tests out of sequence.  Found (3) but expected (2)',
2177             'Tests out of sequence.  Found (4) but expected (3)',
2178             'Tests out of sequence.  Found (6) but expected (4)',
2179             'Tests out of sequence.  Found (8) but expected (5)',
2180             'Tests out of sequence.  Found (9) but expected (6)',
2181             'Tests out of sequence.  Found (10) but expected (7)',
2182             'Tests out of sequence.  Found (11) but expected (8)',
2183             'Tests out of sequence.  Found (12) but expected (9)',
2184             'Tests out of sequence.  Found (13) but expected (10)',
2185             'Plan (1..15) must be at the beginning or end of the TAP output',
2186             'Tests out of sequence.  Found (1) but expected (11)',
2187             'Tests out of sequence.  Found (5) but expected (12)',
2188             'Tests out of sequence.  Found (7) but expected (13)',
2189         ],
2190         'exit' => 0,
2191         wait   => 0,
2192     },
2193     skipall => {
2194         results => [
2195             {   is_plan       => TRUE,
2196                 raw           => '1..0 # skipping: rope',
2197                 tests_planned => 0,
2198                 passed        => TRUE,
2199                 is_ok         => TRUE,
2200                 directive     => 'SKIP',
2201                 explanation   => ''
2202             },
2203         ],
2204         plan          => '1..0',
2205         passed        => [],
2206         actual_passed => [],
2207         failed        => [],
2208         actual_failed => [],
2209         todo          => [],
2210         todo_passed   => [],
2211         skipped       => [],
2212         good_plan     => TRUE,
2213         is_good_plan  => TRUE,
2214         tests_planned => 0,
2215         tests_run     => 0,
2216         parse_errors  => [],
2217         'exit'        => 0,
2218         wait          => 0,
2219         version       => 12,
2220         skip_all      => '(no reason given)',
2221     },
2222     skipall_v13 => {
2223         results => [
2224             {   is_version => TRUE,
2225                 raw        => 'TAP version 13',
2226             },
2227             {   is_unknown => TRUE,
2228                 raw        => '1..0 # skipping: rope',
2229             },
2230         ],
2231         plan          => '',
2232         passed        => [],
2233         actual_passed => [],
2234         failed        => [],
2235         actual_failed => [],
2236         todo          => [],
2237         todo_passed   => [],
2238         skipped       => [],
2239         good_plan     => FALSE,
2240         is_good_plan  => FALSE,
2241         tests_planned => FALSE,
2242         tests_run     => 0,
2243         parse_errors  => ['No plan found in TAP output'],
2244         'exit'        => 0,
2245         wait          => 0,
2246         version       => 13,
2247     },
2248     strict => {
2249         results => [
2250             {   is_version => TRUE,
2251                 raw        => 'TAP version 13',
2252             },
2253             {   is_plan => TRUE,
2254                 raw     => '1..1',
2255             },
2256             {   is_pragma => TRUE,
2257                 raw       => 'pragma +strict',
2258                 pragmas   => ['+strict'],
2259             },
2260             {   is_unknown => TRUE, raw => 'Nonsense!',
2261             },
2262             {   is_pragma => TRUE,
2263                 raw       => 'pragma -strict',
2264                 pragmas   => ['-strict'],
2265             },
2266             {   is_unknown => TRUE,
2267                 raw        => "Doesn't matter.",
2268             },
2269             {   is_test => TRUE,
2270                 raw     => 'ok 1 All OK',
2271             }
2272         ],
2273         plan          => '1..1',
2274         passed        => [1],
2275         actual_passed => [1],
2276         failed        => [],
2277         actual_failed => [],
2278         todo          => [],
2279         todo_passed   => [],
2280         skipped       => [],
2281         good_plan     => TRUE,
2282         is_good_plan  => TRUE,
2283         tests_planned => 1,
2284         tests_run     => 1,
2285         parse_errors  => ['Unknown TAP token: "Nonsense!"'],
2286         'exit'  => 0,    # TODO: Is this right???
2287         wait    => 0,
2288         version => 13,
2289     },
2290     skipall_nomsg => {
2291         results => [
2292             {   is_plan       => TRUE,
2293                 raw           => '1..0',
2294                 tests_planned => 0,
2295                 passed        => TRUE,
2296                 is_ok         => TRUE,
2297                 directive     => 'SKIP',
2298                 explanation   => ''
2299             },
2300         ],
2301         plan          => '1..0',
2302         passed        => [],
2303         actual_passed => [],
2304         failed        => [],
2305         actual_failed => [],
2306         todo          => [],
2307         todo_passed   => [],
2308         skipped       => [],
2309         good_plan     => TRUE,
2310         is_good_plan  => TRUE,
2311         tests_planned => 0,
2312         tests_run     => 0,
2313         parse_errors  => [],
2314         'exit'        => 0,
2315         wait          => 0,
2316         version       => 12,
2317         skip_all      => '(no reason given)',
2318     },
2319     todo_misparse => {
2320         results => [
2321             {   is_plan       => TRUE,
2322                 raw           => '1..1',
2323                 tests_planned => TRUE,
2324                 passed        => TRUE,
2325                 is_ok         => TRUE,
2326             },
2327             {   actual_passed => FALSE,
2328                 is_actual_ok  => FALSE,
2329                 passed        => FALSE,
2330                 is_ok         => FALSE,
2331                 is_test       => TRUE,
2332                 has_skip      => FALSE,
2333                 has_todo      => FALSE,
2334                 number        => 1,
2335                 description   => 'Hamlette # TODOORNOTTODO',
2336                 explanation   => '',
2337             },
2338         ],
2339         plan          => '1..1',
2340         passed        => [],
2341         actual_passed => [],
2342         failed        => [1],
2343         actual_failed => [1],
2344         todo          => [],
2345         todo_passed   => [],
2346         skipped       => [],
2347         good_plan     => TRUE,
2348         is_good_plan  => TRUE,
2349         tests_planned => TRUE,
2350         tests_run     => 1,
2351         parse_errors  => [],
2352         'exit'        => 0,
2353         wait          => 0,
2354         version       => 12,
2355     },
2356     shbang_misparse => {
2357         results => [
2358             {   is_plan       => TRUE,
2359                 raw           => '1..2',
2360                 tests_planned => 2,
2361                 passed        => TRUE,
2362                 is_ok         => TRUE,
2363             },
2364             {   actual_passed => TRUE,
2365                 is_actual_ok  => TRUE,
2366                 description   => "",
2367                 passed        => TRUE,
2368                 is_ok         => TRUE,
2369                 is_test       => TRUE,
2370                 has_skip      => FALSE,
2371                 has_todo      => FALSE,
2372                 number        => 1,
2373             },
2374             {   actual_passed => TRUE,
2375                 is_actual_ok  => TRUE,
2376                 passed        => TRUE,
2377                 is_ok         => TRUE,
2378                 is_test       => TRUE,
2379                 has_skip      => FALSE,
2380                 has_todo      => FALSE,
2381                 number        => 2,
2382                 description   => "",
2383             },
2384         ],
2385         plan          => '1..2',
2386         passed        => [ 1 .. 2 ],
2387         actual_passed => [ 1 .. 2 ],
2388         failed        => [],
2389         actual_failed => [],
2390         todo          => [],
2391         todo_passed   => [],
2392         skipped       => [],
2393         good_plan     => TRUE,
2394         is_good_plan  => TRUE,
2395         tests_planned => 2,
2396         tests_run     => 2,
2397         parse_errors  => [],
2398         'exit'        => 0,
2399         wait          => 0,
2400         version       => 12,
2401     },
2402     switches => {
2403         results => [
2404             {   is_plan       => TRUE,
2405                 passed        => TRUE,
2406                 is_ok         => TRUE,
2407                 raw           => '1..1',
2408                 tests_planned => 1,
2409             },
2410             {   actual_passed => TRUE,
2411                 is_actual_ok  => TRUE,
2412                 passed        => TRUE,
2413                 is_ok         => TRUE,
2414                 is_test       => TRUE,
2415                 has_skip      => FALSE,
2416                 has_todo      => FALSE,
2417                 number        => 1,
2418                 description   => "",
2419                 explanation   => '',
2420             },
2421         ],
2422         __ARGS__      => { switches => ['-Mstrict'] },
2423         plan          => '1..1',
2424         passed        => [1],
2425         actual_passed => [1],
2426         failed        => [],
2427         actual_failed => [],
2428         todo          => [],
2429         todo_passed   => [],
2430         skipped       => [],
2431         good_plan     => TRUE,
2432         is_good_plan  => TRUE,
2433         tests_planned => 1,
2434         tests_run     => TRUE,
2435         parse_errors  => [],
2436         'exit'        => 0,
2437         wait          => 0,
2438         version       => 12,
2439     },
2440     inc_taint => {
2441         results => [
2442             {   is_plan       => TRUE,
2443                 passed        => TRUE,
2444                 is_ok         => TRUE,
2445                 raw           => '1..1',
2446                 tests_planned => 1,
2447             },
2448             {   actual_passed => TRUE,
2449                 is_actual_ok  => TRUE,
2450                 passed        => TRUE,
2451                 is_ok         => TRUE,
2452                 is_test       => TRUE,
2453                 has_skip      => FALSE,
2454                 has_todo      => FALSE,
2455                 number        => 1,
2456                 description   => "",
2457                 explanation   => '',
2458             },
2459         ],
2460         __ARGS__      => { switches => ['-Iexamples'] },
2461         plan          => '1..1',
2462         passed        => [1],
2463         actual_passed => [1],
2464         failed        => [],
2465         actual_failed => [],
2466         todo          => [],
2467         todo_passed   => [],
2468         skipped       => [],
2469         good_plan     => TRUE,
2470         is_good_plan  => TRUE,
2471         tests_planned => 1,
2472         tests_run     => TRUE,
2473         parse_errors  => [],
2474         'exit'        => 0,
2475         wait          => 0,
2476         version       => 12,
2477     },
2478     sequence_misparse => {
2479         results => [
2480             {   is_plan       => TRUE,
2481                 raw           => '1..5',
2482                 tests_planned => 5,
2483                 passed        => TRUE,
2484                 is_ok         => TRUE,
2485             },
2486             {   actual_passed => TRUE,
2487                 is_actual_ok  => TRUE,
2488                 passed        => TRUE,
2489                 is_ok         => TRUE,
2490                 is_test       => TRUE,
2491                 has_skip      => FALSE,
2492                 has_todo      => FALSE,
2493                 number        => 1,
2494                 description   => "",
2495             },
2496             {   actual_passed => TRUE,
2497                 is_actual_ok  => TRUE,
2498                 passed        => TRUE,
2499                 is_ok         => TRUE,
2500                 is_test       => TRUE,
2501                 has_skip      => FALSE,
2502                 has_todo      => FALSE,
2503                 number        => 2,
2504                 description   => "",
2505             },
2506             {   actual_passed => TRUE,
2507                 is_actual_ok  => TRUE,
2508                 passed        => TRUE,
2509                 is_ok         => TRUE,
2510                 is_test       => TRUE,
2511                 has_skip      => FALSE,
2512                 has_todo      => FALSE,
2513                 number        => 3,
2514                 description   => "\# skipped on foobar system",
2515             },
2516             {   is_comment => TRUE,
2517                 comment    => '1234567890123456789012345678901234567890',
2518             },
2519             {   actual_passed => TRUE,
2520                 is_actual_ok  => TRUE,
2521                 passed        => TRUE,
2522                 is_ok         => TRUE,
2523                 is_test       => TRUE,
2524                 has_skip      => FALSE,
2525                 has_todo      => FALSE,
2526                 number        => 4,
2527                 description   => "",
2528             },
2529             {   is_comment => TRUE,
2530                 comment    => '1234567890123456789012345678901234567890',
2531             },
2532             {   actual_passed => TRUE,
2533                 is_actual_ok  => TRUE,
2534                 passed        => TRUE,
2535                 is_ok         => TRUE,
2536                 is_test       => TRUE,
2537                 has_skip      => FALSE,
2538                 has_todo      => FALSE,
2539                 number        => 5,
2540                 description   => "",
2541             },
2542         ],
2543         plan          => '1..5',
2544         passed        => [ 1 .. 5 ],
2545         actual_passed => [ 1 .. 5 ],
2546         failed        => [],
2547         actual_failed => [],
2548         todo          => [],
2549         todo_passed   => [],
2550         skipped       => [],
2551         good_plan     => TRUE,
2552         is_good_plan  => TRUE,
2553         tests_planned => 5,
2554         tests_run     => 5,
2555         parse_errors  => [],
2556         'exit'        => 0,
2557         wait          => 0,
2558         version       => 12,
2559     },
2560
2561     stdout_stderr => {
2562         results => [
2563             {   is_comment => TRUE,
2564                 passed     => TRUE,
2565                 is_ok      => TRUE,
2566                 comment    => 'comments',
2567             },
2568             {   actual_passed => TRUE,
2569                 is_actual_ok  => TRUE,
2570                 passed        => TRUE,
2571                 is_ok         => TRUE,
2572                 is_test       => TRUE,
2573                 has_skip      => FALSE,
2574                 has_todo      => FALSE,
2575                 number        => 1,
2576                 description   => '',
2577                 explanation   => '',
2578             },
2579             {   actual_passed => TRUE,
2580                 is_actual_ok  => TRUE,
2581                 passed        => TRUE,
2582                 is_ok         => TRUE,
2583                 is_test       => TRUE,
2584                 has_skip      => FALSE,
2585                 has_todo      => FALSE,
2586                 number        => 2,
2587                 description   => '',
2588                 explanation   => '',
2589             },
2590             {   actual_passed => TRUE,
2591                 is_actual_ok  => TRUE,
2592                 passed        => TRUE,
2593                 is_ok         => TRUE,
2594                 is_test       => TRUE,
2595                 has_skip      => FALSE,
2596                 has_todo      => FALSE,
2597                 number        => 3,
2598                 description   => '',
2599                 explanation   => '',
2600             },
2601             {   is_comment => TRUE,
2602                 passed     => TRUE,
2603                 is_ok      => TRUE,
2604                 comment    => 'comment',
2605             },
2606             {   actual_passed => TRUE,
2607                 is_actual_ok  => TRUE,
2608                 passed        => TRUE,
2609                 is_ok         => TRUE,
2610                 is_test       => TRUE,
2611                 has_skip      => FALSE,
2612                 has_todo      => FALSE,
2613                 number        => 4,
2614                 description   => '',
2615                 explanation   => '',
2616             },
2617             {   is_comment => TRUE,
2618                 passed     => TRUE,
2619                 is_ok      => TRUE,
2620                 comment    => 'more ignored stuff',
2621             },
2622             {   is_comment => TRUE,
2623                 passed     => TRUE,
2624                 is_ok      => TRUE,
2625                 comment    => 'and yet more',
2626             },
2627             {   is_plan       => TRUE,
2628                 passed        => TRUE,
2629                 is_ok         => TRUE,
2630                 raw           => '1..4',
2631                 tests_planned => 4,
2632             },
2633         ],
2634         plan          => '1..4',
2635         passed        => [ 1 .. 4 ],
2636         actual_passed => [ 1 .. 4 ],
2637         failed        => [],
2638         actual_failed => [],
2639         todo          => [],
2640         todo_passed   => [],
2641         skipped       => [],
2642         good_plan     => TRUE,
2643         is_good_plan  => TRUE,
2644         tests_planned => 4,
2645         tests_run     => 4,
2646         parse_errors  => [],
2647         'exit'        => 0,
2648         wait          => 0,
2649         version       => 12,
2650         need_open3    => 1,
2651     },
2652
2653     junk_before_plan => {
2654         results => [
2655             {   is_unknown => TRUE,
2656                 raw        => 'this is junk',
2657             },
2658             {   is_comment => TRUE,
2659                 comment    => "this is a comment",
2660             },
2661             {   is_plan       => TRUE,
2662                 passed        => TRUE,
2663                 is_ok         => TRUE,
2664                 raw           => '1..1',
2665                 tests_planned => 1,
2666             },
2667             {   actual_passed => TRUE,
2668                 is_actual_ok  => TRUE,
2669                 passed        => TRUE,
2670                 is_ok         => TRUE,
2671                 is_test       => TRUE,
2672                 has_skip      => FALSE,
2673                 has_todo      => FALSE,
2674                 number        => 1,
2675             },
2676         ],
2677         plan          => '1..1',
2678         passed        => [ 1 .. 1 ],
2679         actual_passed => [ 1 .. 1 ],
2680         failed        => [],
2681         actual_failed => [],
2682         todo          => [],
2683         todo_passed   => [],
2684         skipped       => [],
2685         good_plan     => TRUE,
2686         is_good_plan  => TRUE,
2687         tests_planned => 1,
2688         tests_run     => 1,
2689         parse_errors  => [],
2690         'exit'        => 0,
2691         wait          => 0,
2692         version       => 12,
2693     },
2694     version_good => {
2695         results => [
2696             {   is_version => TRUE,
2697                 raw        => 'TAP version 13',
2698             },
2699             {   is_plan       => TRUE,
2700                 raw           => '1..5',
2701                 tests_planned => 5,
2702                 passed        => TRUE,
2703                 is_ok         => TRUE,
2704             },
2705             {   actual_passed => TRUE,
2706                 is_actual_ok  => TRUE,
2707                 passed        => TRUE,
2708                 is_ok         => TRUE,
2709                 is_test       => TRUE,
2710                 has_skip      => FALSE,
2711                 has_todo      => FALSE,
2712                 number        => 1,
2713                 description   => "",
2714             },
2715             {   actual_passed => TRUE,
2716                 is_actual_ok  => TRUE,
2717                 passed        => TRUE,
2718                 is_ok         => TRUE,
2719                 is_test       => TRUE,
2720                 has_skip      => FALSE,
2721                 has_todo      => FALSE,
2722                 number        => 2,
2723                 description   => "",
2724             },
2725             {   actual_passed => TRUE,
2726                 is_actual_ok  => TRUE,
2727                 passed        => TRUE,
2728                 is_ok         => TRUE,
2729                 is_test       => TRUE,
2730                 has_skip      => FALSE,
2731                 has_todo      => FALSE,
2732                 number        => 3,
2733                 description   => "",
2734             },
2735             {   actual_passed => TRUE,
2736                 is_actual_ok  => TRUE,
2737                 passed        => TRUE,
2738                 is_ok         => TRUE,
2739                 is_test       => TRUE,
2740                 has_skip      => FALSE,
2741                 has_todo      => FALSE,
2742                 number        => 4,
2743                 description   => "",
2744             },
2745             {   actual_passed => TRUE,
2746                 is_actual_ok  => TRUE,
2747                 passed        => TRUE,
2748                 is_ok         => TRUE,
2749                 is_test       => TRUE,
2750                 has_skip      => FALSE,
2751                 has_todo      => FALSE,
2752                 number        => 5,
2753                 description   => "",
2754             },
2755         ],
2756         plan          => '1..5',
2757         passed        => [ 1 .. 5 ],
2758         actual_passed => [ 1 .. 5 ],
2759         failed        => [],
2760         actual_failed => [],
2761         todo          => [],
2762         todo_passed   => [],
2763         skipped       => [],
2764         good_plan     => TRUE,
2765         is_good_plan  => TRUE,
2766         tests_planned => 5,
2767         tests_run     => 5,
2768         parse_errors  => [],
2769         'exit'        => 0,
2770         wait          => 0,
2771         version       => 13,
2772     },
2773     version_old => {
2774         results => [
2775             {   is_version => TRUE,
2776                 raw        => 'TAP version 12',
2777             },
2778             {   is_plan       => TRUE,
2779                 raw           => '1..5',
2780                 tests_planned => 5,
2781                 passed        => TRUE,
2782                 is_ok         => TRUE,
2783             },
2784             {   actual_passed => TRUE,
2785                 is_actual_ok  => TRUE,
2786                 passed        => TRUE,
2787                 is_ok         => TRUE,
2788                 is_test       => TRUE,
2789                 has_skip      => FALSE,
2790                 has_todo      => FALSE,
2791                 number        => 1,
2792                 description   => "",
2793             },
2794             {   actual_passed => TRUE,
2795                 is_actual_ok  => TRUE,
2796                 passed        => TRUE,
2797                 is_ok         => TRUE,
2798                 is_test       => TRUE,
2799                 has_skip      => FALSE,
2800                 has_todo      => FALSE,
2801                 number        => 2,
2802                 description   => "",
2803             },
2804             {   actual_passed => TRUE,
2805                 is_actual_ok  => TRUE,
2806                 passed        => TRUE,
2807                 is_ok         => TRUE,
2808                 is_test       => TRUE,
2809                 has_skip      => FALSE,
2810                 has_todo      => FALSE,
2811                 number        => 3,
2812                 description   => "",
2813             },
2814             {   actual_passed => TRUE,
2815                 is_actual_ok  => TRUE,
2816                 passed        => TRUE,
2817                 is_ok         => TRUE,
2818                 is_test       => TRUE,
2819                 has_skip      => FALSE,
2820                 has_todo      => FALSE,
2821                 number        => 4,
2822                 description   => "",
2823             },
2824             {   actual_passed => TRUE,
2825                 is_actual_ok  => TRUE,
2826                 passed        => TRUE,
2827                 is_ok         => TRUE,
2828                 is_test       => TRUE,
2829                 has_skip      => FALSE,
2830                 has_todo      => FALSE,
2831                 number        => 5,
2832                 description   => "",
2833             },
2834         ],
2835         plan          => '1..5',
2836         passed        => [ 1 .. 5 ],
2837         actual_passed => [ 1 .. 5 ],
2838         failed        => [],
2839         actual_failed => [],
2840         todo          => [],
2841         todo_passed   => [],
2842         skipped       => [],
2843         good_plan     => TRUE,
2844         is_good_plan  => TRUE,
2845         tests_planned => 5,
2846         tests_run     => 5,
2847         parse_errors =>
2848           ['Explicit TAP version must be at least 13. Got version 12'],
2849         'exit'  => 0,
2850         wait    => 0,
2851         version => 12,
2852     },
2853     version_late => {
2854         results => [
2855             {   is_plan       => TRUE,
2856                 raw           => '1..5',
2857                 tests_planned => 5,
2858                 passed        => TRUE,
2859                 is_ok         => TRUE,
2860             },
2861             {   is_version => TRUE,
2862                 raw        => 'TAP version 13',
2863             },
2864             {   actual_passed => TRUE,
2865                 is_actual_ok  => TRUE,
2866                 passed        => TRUE,
2867                 is_ok         => TRUE,
2868                 is_test       => TRUE,
2869                 has_skip      => FALSE,
2870                 has_todo      => FALSE,
2871                 number        => 1,
2872                 description   => "",
2873             },
2874             {   actual_passed => TRUE,
2875                 is_actual_ok  => TRUE,
2876                 passed        => TRUE,
2877                 is_ok         => TRUE,
2878                 is_test       => TRUE,
2879                 has_skip      => FALSE,
2880                 has_todo      => FALSE,
2881                 number        => 2,
2882                 description   => "",
2883             },
2884             {   actual_passed => TRUE,
2885                 is_actual_ok  => TRUE,
2886                 passed        => TRUE,
2887                 is_ok         => TRUE,
2888                 is_test       => TRUE,
2889                 has_skip      => FALSE,
2890                 has_todo      => FALSE,
2891                 number        => 3,
2892                 description   => "",
2893             },
2894             {   actual_passed => TRUE,
2895                 is_actual_ok  => TRUE,
2896                 passed        => TRUE,
2897                 is_ok         => TRUE,
2898                 is_test       => TRUE,
2899                 has_skip      => FALSE,
2900                 has_todo      => FALSE,
2901                 number        => 4,
2902                 description   => "",
2903             },
2904             {   actual_passed => TRUE,
2905                 is_actual_ok  => TRUE,
2906                 passed        => TRUE,
2907                 is_ok         => TRUE,
2908                 is_test       => TRUE,
2909                 has_skip      => FALSE,
2910                 has_todo      => FALSE,
2911                 number        => 5,
2912                 description   => "",
2913             },
2914         ],
2915         plan          => '1..5',
2916         passed        => [ 1 .. 5 ],
2917         actual_passed => [ 1 .. 5 ],
2918         failed        => [],
2919         actual_failed => [],
2920         todo          => [],
2921         todo_passed   => [],
2922         skipped       => [],
2923         good_plan     => TRUE,
2924         is_good_plan  => TRUE,
2925         tests_planned => 5,
2926         tests_run     => 5,
2927         parse_errors =>
2928           ['If TAP version is present it must be the first line of output'],
2929         'exit'  => 0,
2930         wait    => 0,
2931         version => 12,
2932     },
2933
2934     escape_eol => {
2935         results => [
2936             {   is_plan       => TRUE,
2937                 raw           => '1..2',
2938                 tests_planned => 2,
2939                 passed        => TRUE,
2940                 is_ok         => TRUE,
2941             },
2942             {   actual_passed => TRUE,
2943                 is_actual_ok  => TRUE,
2944                 description =>
2945                   'Should parse as literal backslash --> \\',
2946                 passed       => TRUE,
2947                 is_ok        => TRUE,
2948                 is_test      => TRUE,
2949                 has_skip     => FALSE,
2950                 has_todo     => FALSE,
2951                 number       => 1,
2952                 is_unplanned => FALSE,
2953             },
2954             {   actual_passed => TRUE,
2955                 is_actual_ok  => TRUE,
2956                 passed        => TRUE,
2957                 is_ok         => TRUE,
2958                 is_test       => TRUE,
2959                 has_skip      => FALSE,
2960                 has_todo      => FALSE,
2961                 number        => 2,
2962                 description   => 'Not a continuation line',
2963                 is_unplanned  => FALSE,
2964             },
2965         ],
2966         plan          => '1..2',
2967         passed        => [ 1 .. 2 ],
2968         actual_passed => [ 1 .. 2 ],
2969         failed        => [],
2970         actual_failed => [],
2971         todo          => [],
2972         todo_passed   => [],
2973         skipped       => [],
2974         good_plan     => TRUE,
2975         is_good_plan  => TRUE,
2976         tests_planned => 2,
2977         tests_run     => 2,
2978         parse_errors  => [],
2979         'exit'        => 0,
2980         wait          => 0,
2981         version       => 12,
2982     },
2983
2984     escape_hash => {
2985         results => [
2986             {   is_plan       => TRUE,
2987                 raw           => '1..3',
2988                 tests_planned => 3,
2989                 passed        => TRUE,
2990                 is_ok         => TRUE,
2991             },
2992             {   actual_passed => TRUE,
2993                 is_actual_ok  => TRUE,
2994                 description   => 'Not a \\# TODO',
2995                 passed        => TRUE,
2996                 is_ok         => TRUE,
2997                 is_test       => TRUE,
2998                 has_skip      => FALSE,
2999                 has_todo      => FALSE,
3000                 number        => 1,
3001                 is_unplanned  => FALSE,
3002             },
3003             {   actual_passed => TRUE,
3004                 is_actual_ok  => TRUE,
3005                 passed        => TRUE,
3006                 is_ok         => TRUE,
3007                 is_test       => TRUE,
3008                 has_skip      => FALSE,
3009                 has_todo      => FALSE,
3010                 number        => 2,
3011                 description   => 'Not a \\# SKIP',
3012                 is_unplanned  => FALSE,
3013             },
3014             {   actual_passed => TRUE,
3015                 is_actual_ok  => TRUE,
3016                 passed        => TRUE,
3017                 is_ok         => TRUE,
3018                 is_test       => TRUE,
3019                 has_skip      => FALSE,
3020                 has_todo      => FALSE,
3021                 number        => 3,
3022                 description   => 'Escaped \\\\\\#',
3023                 is_unplanned  => FALSE,
3024             },
3025         ],
3026         plan          => '1..3',
3027         passed        => [ 1 .. 3 ],
3028         actual_passed => [ 1 .. 3 ],
3029         failed        => [],
3030         actual_failed => [],
3031         todo          => [],
3032         todo_passed   => [],
3033         skipped       => [],
3034         good_plan     => TRUE,
3035         is_good_plan  => TRUE,
3036         tests_planned => 3,
3037         tests_run     => 3,
3038         parse_errors  => [],
3039         'exit'        => 0,
3040         wait          => 0,
3041         version       => 12,
3042     },
3043 );
3044
3045 my %HANDLER_FOR = (
3046     NOT_ZERO, sub { local $^W; 0 != shift },
3047     TRUE,     sub { local $^W; !!shift },
3048     FALSE,    sub { local $^W; !shift },
3049 );
3050
3051 my $can_open3 = ( $Config{d_fork} || $IsWin32 ) ? 1 : 0;
3052
3053 for my $hide_fork ( 0 .. $can_open3 ) {
3054     if ($hide_fork) {
3055         no strict 'refs';
3056         local $^W = 0;
3057         *{'TAP::Parser::Iterator::Process::_use_open3'} = sub {return};
3058     }
3059
3060     TEST:
3061     for my $test ( sort keys %samples ) {
3062
3063         #next unless 'empty' eq $test;
3064         my %details = %{ $samples{$test} };
3065
3066         if ( my $skip_if = delete $details{skip_if} ) {
3067             next TEST if $skip_if->();
3068         }
3069
3070         my $results    = delete $details{results};
3071         my $args       = delete $details{__ARGS__};
3072         my $need_open3 = delete $details{need_open3};
3073
3074         next TEST if $need_open3 && ( $hide_fork || !$can_open3 );
3075
3076         # the following acrobatics are necessary to make it easy for the
3077         # Test::Builder::failure_output() method to be overridden when
3078         # TAP::Parser is not installed.  Otherwise, these tests will fail.
3079
3080         unshift @{ $args->{switches} },
3081           $ENV{PERL_CORE} ? ( map {"-I$_"} @INC ) : ('-It/lib');
3082
3083         $args->{source} = File::Spec->catfile( $SAMPLE_TESTS, $test );
3084         $args->{merge} = !$hide_fork;
3085
3086         my $parser = eval { analyze_test( $test, [@$results], $args ) };
3087         my $error = $@;
3088         ok !$error, "'$test' should parse successfully"
3089           or diag $error;
3090
3091         if ($error) {
3092             my $tests = 0;
3093             while ( my ( $method, $answer ) = each %details ) {
3094                 $tests += ref $answer ? 2 : 1;
3095             }
3096             SKIP: {
3097                 skip "$test did not parse successfully", $tests;
3098             }
3099         }
3100         else {
3101             while ( my ( $method, $answer ) = each %details ) {
3102                 if ( my $handler = $HANDLER_FOR{ $answer || '' } ) {    # yuck
3103                     ok $handler->( $parser->$method() ),
3104                       "... and $method should return a reasonable value ($test)";
3105                 }
3106                 elsif ( !ref $answer ) {
3107                     local $^W;    # uninit warnings
3108
3109                     $answer = _vmsify_answer( $method, $answer );
3110
3111                     is $parser->$method(), $answer,
3112                       "... and $method should equal $answer ($test)";
3113                 }
3114                 else {
3115                     is scalar $parser->$method(), scalar @$answer,
3116                       "... and $method should be the correct amount ($test)";
3117                     is_deeply [ $parser->$method() ], $answer,
3118                       "... and $method should be the correct values ($test)";
3119                 }
3120             }
3121         }
3122     }
3123 }
3124
3125 my %Unix2VMS_Exit_Codes = ( 1 => 4, );
3126
3127 sub _vmsify_answer {
3128     my ( $method, $answer ) = @_;
3129
3130     return $answer unless $IsVMS;
3131
3132     if ( $method eq 'exit'
3133         and exists $Unix2VMS_Exit_Codes{$answer} )
3134     {
3135         $answer = $Unix2VMS_Exit_Codes{$answer};
3136     }
3137
3138     return $answer;
3139 }
3140
3141 sub analyze_test {
3142     my ( $test, $results, $args ) = @_;
3143
3144     my $parser = TAP::Parser->new($args);
3145     my $count  = 1;
3146     while ( defined( my $result = $parser->next ) ) {
3147
3148         my $expected = shift @$results;
3149         my $desc
3150           = $result->is_test
3151           ? $result->description
3152           : $result->raw;
3153         $desc = $result->plan
3154           if $result->is_plan && $desc =~ /SKIP/i;
3155         $desc =~ s/#/<hash>/g;
3156         $desc =~ s/\s+/ /g;      # Drop newlines
3157         ok defined $expected,
3158           "$test/$count We should have a result for $desc";
3159         while ( my ( $method, $answer ) = each %$expected ) {
3160
3161             if ( my $handler = $HANDLER_FOR{ $answer || '' } ) {    # yuck
3162                 ok $handler->( $result->$method() ),
3163                   "... and $method should return a reasonable value ($test/$count)";
3164             }
3165             elsif ( ref $answer ) {
3166                 is_deeply scalar( $result->$method() ), $answer,
3167                   "... and $method should return the correct structure ($test/$count)";
3168             }
3169             else {
3170                 is $result->$method(), $answer,
3171                   "... and $method should return the correct answer ($test/$count)";
3172             }
3173         }
3174         $count++;
3175     }
3176     is @$results, 0,
3177       "... and we should have the correct number of results ($test)";
3178     return $parser;
3179 }
3180
3181 # vms_nit