bring Test::Harness up to 3.06
[p5sagit/p5-mst-13.2.git] / lib / Test / Harness / 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   => 'rope'
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      => 'rope',
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     skipall_nomsg => {
2249         results => [
2250             {   is_plan       => TRUE,
2251                 raw           => '1..0',
2252                 tests_planned => 0,
2253                 passed        => TRUE,
2254                 is_ok         => TRUE,
2255                 directive     => 'SKIP',
2256                 explanation   => ''
2257             },
2258         ],
2259         plan          => '1..0',
2260         passed        => [],
2261         actual_passed => [],
2262         failed        => [],
2263         actual_failed => [],
2264         todo          => [],
2265         todo_passed   => [],
2266         skipped       => [],
2267         good_plan     => TRUE,
2268         is_good_plan  => TRUE,
2269         tests_planned => 0,
2270         tests_run     => 0,
2271         parse_errors  => [],
2272         'exit'        => 0,
2273         wait          => 0,
2274         version       => 12,
2275         skip_all      => '(no reason given)',
2276     },
2277     todo_misparse => {
2278         results => [
2279             {   is_plan       => TRUE,
2280                 raw           => '1..1',
2281                 tests_planned => TRUE,
2282                 passed        => TRUE,
2283                 is_ok         => TRUE,
2284             },
2285             {   actual_passed => FALSE,
2286                 is_actual_ok  => FALSE,
2287                 passed        => FALSE,
2288                 is_ok         => FALSE,
2289                 is_test       => TRUE,
2290                 has_skip      => FALSE,
2291                 has_todo      => FALSE,
2292                 number        => 1,
2293                 description   => 'Hamlette # TODOORNOTTODO',
2294                 explanation   => '',
2295             },
2296         ],
2297         plan          => '1..1',
2298         passed        => [],
2299         actual_passed => [],
2300         failed        => [1],
2301         actual_failed => [1],
2302         todo          => [],
2303         todo_passed   => [],
2304         skipped       => [],
2305         good_plan     => TRUE,
2306         is_good_plan  => TRUE,
2307         tests_planned => TRUE,
2308         tests_run     => 1,
2309         parse_errors  => [],
2310         'exit'        => 0,
2311         wait          => 0,
2312         version       => 12,
2313     },
2314     shbang_misparse => {
2315         results => [
2316             {   is_plan       => TRUE,
2317                 raw           => '1..2',
2318                 tests_planned => 2,
2319                 passed        => TRUE,
2320                 is_ok         => TRUE,
2321             },
2322             {   actual_passed => TRUE,
2323                 is_actual_ok  => TRUE,
2324                 description   => "",
2325                 passed        => TRUE,
2326                 is_ok         => TRUE,
2327                 is_test       => TRUE,
2328                 has_skip      => FALSE,
2329                 has_todo      => FALSE,
2330                 number        => 1,
2331             },
2332             {   actual_passed => TRUE,
2333                 is_actual_ok  => TRUE,
2334                 passed        => TRUE,
2335                 is_ok         => TRUE,
2336                 is_test       => TRUE,
2337                 has_skip      => FALSE,
2338                 has_todo      => FALSE,
2339                 number        => 2,
2340                 description   => "",
2341             },
2342         ],
2343         plan          => '1..2',
2344         passed        => [ 1 .. 2 ],
2345         actual_passed => [ 1 .. 2 ],
2346         failed        => [],
2347         actual_failed => [],
2348         todo          => [],
2349         todo_passed   => [],
2350         skipped       => [],
2351         good_plan     => TRUE,
2352         is_good_plan  => TRUE,
2353         tests_planned => 2,
2354         tests_run     => 2,
2355         parse_errors  => [],
2356         'exit'        => 0,
2357         wait          => 0,
2358         version       => 12,
2359     },
2360     switches => {
2361         results => [
2362             {   is_plan       => TRUE,
2363                 passed        => TRUE,
2364                 is_ok         => TRUE,
2365                 raw           => '1..1',
2366                 tests_planned => 1,
2367             },
2368             {   actual_passed => TRUE,
2369                 is_actual_ok  => TRUE,
2370                 passed        => TRUE,
2371                 is_ok         => TRUE,
2372                 is_test       => TRUE,
2373                 has_skip      => FALSE,
2374                 has_todo      => FALSE,
2375                 number        => 1,
2376                 description   => "",
2377                 explanation   => '',
2378             },
2379         ],
2380         __ARGS__      => { switches => ['-Mstrict'] },
2381         plan          => '1..1',
2382         passed        => [1],
2383         actual_passed => [1],
2384         failed        => [],
2385         actual_failed => [],
2386         todo          => [],
2387         todo_passed   => [],
2388         skipped       => [],
2389         good_plan     => TRUE,
2390         is_good_plan  => TRUE,
2391         tests_planned => 1,
2392         tests_run     => TRUE,
2393         parse_errors  => [],
2394         'exit'        => 0,
2395         wait          => 0,
2396         version       => 12,
2397     },
2398     inc_taint => {
2399         results => [
2400             {   is_plan       => TRUE,
2401                 passed        => TRUE,
2402                 is_ok         => TRUE,
2403                 raw           => '1..1',
2404                 tests_planned => 1,
2405             },
2406             {   actual_passed => TRUE,
2407                 is_actual_ok  => TRUE,
2408                 passed        => TRUE,
2409                 is_ok         => TRUE,
2410                 is_test       => TRUE,
2411                 has_skip      => FALSE,
2412                 has_todo      => FALSE,
2413                 number        => 1,
2414                 description   => "",
2415                 explanation   => '',
2416             },
2417         ],
2418         __ARGS__      => { switches => ['-Iexamples'] },
2419         plan          => '1..1',
2420         passed        => [1],
2421         actual_passed => [1],
2422         failed        => [],
2423         actual_failed => [],
2424         todo          => [],
2425         todo_passed   => [],
2426         skipped       => [],
2427         good_plan     => TRUE,
2428         is_good_plan  => TRUE,
2429         tests_planned => 1,
2430         tests_run     => TRUE,
2431         parse_errors  => [],
2432         'exit'        => 0,
2433         wait          => 0,
2434         version       => 12,
2435     },
2436     sequence_misparse => {
2437         results => [
2438             {   is_plan       => TRUE,
2439                 raw           => '1..5',
2440                 tests_planned => 5,
2441                 passed        => TRUE,
2442                 is_ok         => TRUE,
2443             },
2444             {   actual_passed => TRUE,
2445                 is_actual_ok  => TRUE,
2446                 passed        => TRUE,
2447                 is_ok         => TRUE,
2448                 is_test       => TRUE,
2449                 has_skip      => FALSE,
2450                 has_todo      => FALSE,
2451                 number        => 1,
2452                 description   => "",
2453             },
2454             {   actual_passed => TRUE,
2455                 is_actual_ok  => TRUE,
2456                 passed        => TRUE,
2457                 is_ok         => TRUE,
2458                 is_test       => TRUE,
2459                 has_skip      => FALSE,
2460                 has_todo      => FALSE,
2461                 number        => 2,
2462                 description   => "",
2463             },
2464             {   actual_passed => TRUE,
2465                 is_actual_ok  => TRUE,
2466                 passed        => TRUE,
2467                 is_ok         => TRUE,
2468                 is_test       => TRUE,
2469                 has_skip      => FALSE,
2470                 has_todo      => FALSE,
2471                 number        => 3,
2472                 description   => "\# skipped on foobar system",
2473             },
2474             {   is_comment => TRUE,
2475                 comment    => '1234567890123456789012345678901234567890',
2476             },
2477             {   actual_passed => TRUE,
2478                 is_actual_ok  => TRUE,
2479                 passed        => TRUE,
2480                 is_ok         => TRUE,
2481                 is_test       => TRUE,
2482                 has_skip      => FALSE,
2483                 has_todo      => FALSE,
2484                 number        => 4,
2485                 description   => "",
2486             },
2487             {   is_comment => TRUE,
2488                 comment    => '1234567890123456789012345678901234567890',
2489             },
2490             {   actual_passed => TRUE,
2491                 is_actual_ok  => TRUE,
2492                 passed        => TRUE,
2493                 is_ok         => TRUE,
2494                 is_test       => TRUE,
2495                 has_skip      => FALSE,
2496                 has_todo      => FALSE,
2497                 number        => 5,
2498                 description   => "",
2499             },
2500         ],
2501         plan          => '1..5',
2502         passed        => [ 1 .. 5 ],
2503         actual_passed => [ 1 .. 5 ],
2504         failed        => [],
2505         actual_failed => [],
2506         todo          => [],
2507         todo_passed   => [],
2508         skipped       => [],
2509         good_plan     => TRUE,
2510         is_good_plan  => TRUE,
2511         tests_planned => 5,
2512         tests_run     => 5,
2513         parse_errors  => [],
2514         'exit'        => 0,
2515         wait          => 0,
2516         version       => 12,
2517     },
2518
2519     stdout_stderr => {
2520         results => [
2521             {   is_comment => TRUE,
2522                 passed     => TRUE,
2523                 is_ok      => TRUE,
2524                 comment    => 'comments',
2525             },
2526             {   actual_passed => TRUE,
2527                 is_actual_ok  => TRUE,
2528                 passed        => TRUE,
2529                 is_ok         => TRUE,
2530                 is_test       => TRUE,
2531                 has_skip      => FALSE,
2532                 has_todo      => FALSE,
2533                 number        => 1,
2534                 description   => '',
2535                 explanation   => '',
2536             },
2537             {   actual_passed => TRUE,
2538                 is_actual_ok  => TRUE,
2539                 passed        => TRUE,
2540                 is_ok         => TRUE,
2541                 is_test       => TRUE,
2542                 has_skip      => FALSE,
2543                 has_todo      => FALSE,
2544                 number        => 2,
2545                 description   => '',
2546                 explanation   => '',
2547             },
2548             {   actual_passed => TRUE,
2549                 is_actual_ok  => TRUE,
2550                 passed        => TRUE,
2551                 is_ok         => TRUE,
2552                 is_test       => TRUE,
2553                 has_skip      => FALSE,
2554                 has_todo      => FALSE,
2555                 number        => 3,
2556                 description   => '',
2557                 explanation   => '',
2558             },
2559             {   is_comment => TRUE,
2560                 passed     => TRUE,
2561                 is_ok      => TRUE,
2562                 comment    => 'comment',
2563             },
2564             {   actual_passed => TRUE,
2565                 is_actual_ok  => TRUE,
2566                 passed        => TRUE,
2567                 is_ok         => TRUE,
2568                 is_test       => TRUE,
2569                 has_skip      => FALSE,
2570                 has_todo      => FALSE,
2571                 number        => 4,
2572                 description   => '',
2573                 explanation   => '',
2574             },
2575             {   is_comment => TRUE,
2576                 passed     => TRUE,
2577                 is_ok      => TRUE,
2578                 comment    => 'more ignored stuff',
2579             },
2580             {   is_comment => TRUE,
2581                 passed     => TRUE,
2582                 is_ok      => TRUE,
2583                 comment    => 'and yet more',
2584             },
2585             {   is_plan       => TRUE,
2586                 passed        => TRUE,
2587                 is_ok         => TRUE,
2588                 raw           => '1..4',
2589                 tests_planned => 4,
2590             },
2591         ],
2592         plan          => '1..4',
2593         passed        => [ 1 .. 4 ],
2594         actual_passed => [ 1 .. 4 ],
2595         failed        => [],
2596         actual_failed => [],
2597         todo          => [],
2598         todo_passed   => [],
2599         skipped       => [],
2600         good_plan     => TRUE,
2601         is_good_plan  => TRUE,
2602         tests_planned => 4,
2603         tests_run     => 4,
2604         parse_errors  => [],
2605         'exit'        => 0,
2606         wait          => 0,
2607         version       => 12,
2608         need_open3    => 1,
2609     },
2610
2611     junk_before_plan => {
2612         results => [
2613             {   is_unknown => TRUE,
2614                 raw        => 'this is junk',
2615             },
2616             {   is_comment => TRUE,
2617                 comment    => "this is a comment",
2618             },
2619             {   is_plan       => TRUE,
2620                 passed        => TRUE,
2621                 is_ok         => TRUE,
2622                 raw           => '1..1',
2623                 tests_planned => 1,
2624             },
2625             {   actual_passed => TRUE,
2626                 is_actual_ok  => TRUE,
2627                 passed        => TRUE,
2628                 is_ok         => TRUE,
2629                 is_test       => TRUE,
2630                 has_skip      => FALSE,
2631                 has_todo      => FALSE,
2632                 number        => 1,
2633             },
2634         ],
2635         plan          => '1..1',
2636         passed        => [ 1 .. 1 ],
2637         actual_passed => [ 1 .. 1 ],
2638         failed        => [],
2639         actual_failed => [],
2640         todo          => [],
2641         todo_passed   => [],
2642         skipped       => [],
2643         good_plan     => TRUE,
2644         is_good_plan  => TRUE,
2645         tests_planned => 1,
2646         tests_run     => 1,
2647         parse_errors  => [],
2648         'exit'        => 0,
2649         wait          => 0,
2650         version       => 12,
2651     },
2652     version_good => {
2653         results => [
2654             {   is_version => TRUE,
2655                 raw        => 'TAP version 13',
2656             },
2657             {   is_plan       => TRUE,
2658                 raw           => '1..5',
2659                 tests_planned => 5,
2660                 passed        => TRUE,
2661                 is_ok         => TRUE,
2662             },
2663             {   actual_passed => TRUE,
2664                 is_actual_ok  => TRUE,
2665                 passed        => TRUE,
2666                 is_ok         => TRUE,
2667                 is_test       => TRUE,
2668                 has_skip      => FALSE,
2669                 has_todo      => FALSE,
2670                 number        => 1,
2671                 description   => "",
2672             },
2673             {   actual_passed => TRUE,
2674                 is_actual_ok  => TRUE,
2675                 passed        => TRUE,
2676                 is_ok         => TRUE,
2677                 is_test       => TRUE,
2678                 has_skip      => FALSE,
2679                 has_todo      => FALSE,
2680                 number        => 2,
2681                 description   => "",
2682             },
2683             {   actual_passed => TRUE,
2684                 is_actual_ok  => TRUE,
2685                 passed        => TRUE,
2686                 is_ok         => TRUE,
2687                 is_test       => TRUE,
2688                 has_skip      => FALSE,
2689                 has_todo      => FALSE,
2690                 number        => 3,
2691                 description   => "",
2692             },
2693             {   actual_passed => TRUE,
2694                 is_actual_ok  => TRUE,
2695                 passed        => TRUE,
2696                 is_ok         => TRUE,
2697                 is_test       => TRUE,
2698                 has_skip      => FALSE,
2699                 has_todo      => FALSE,
2700                 number        => 4,
2701                 description   => "",
2702             },
2703             {   actual_passed => TRUE,
2704                 is_actual_ok  => TRUE,
2705                 passed        => TRUE,
2706                 is_ok         => TRUE,
2707                 is_test       => TRUE,
2708                 has_skip      => FALSE,
2709                 has_todo      => FALSE,
2710                 number        => 5,
2711                 description   => "",
2712             },
2713         ],
2714         plan          => '1..5',
2715         passed        => [ 1 .. 5 ],
2716         actual_passed => [ 1 .. 5 ],
2717         failed        => [],
2718         actual_failed => [],
2719         todo          => [],
2720         todo_passed   => [],
2721         skipped       => [],
2722         good_plan     => TRUE,
2723         is_good_plan  => TRUE,
2724         tests_planned => 5,
2725         tests_run     => 5,
2726         parse_errors  => [],
2727         'exit'        => 0,
2728         wait          => 0,
2729         version       => 13,
2730     },
2731     version_old => {
2732         results => [
2733             {   is_version => TRUE,
2734                 raw        => 'TAP version 12',
2735             },
2736             {   is_plan       => TRUE,
2737                 raw           => '1..5',
2738                 tests_planned => 5,
2739                 passed        => TRUE,
2740                 is_ok         => TRUE,
2741             },
2742             {   actual_passed => TRUE,
2743                 is_actual_ok  => TRUE,
2744                 passed        => TRUE,
2745                 is_ok         => TRUE,
2746                 is_test       => TRUE,
2747                 has_skip      => FALSE,
2748                 has_todo      => FALSE,
2749                 number        => 1,
2750                 description   => "",
2751             },
2752             {   actual_passed => TRUE,
2753                 is_actual_ok  => TRUE,
2754                 passed        => TRUE,
2755                 is_ok         => TRUE,
2756                 is_test       => TRUE,
2757                 has_skip      => FALSE,
2758                 has_todo      => FALSE,
2759                 number        => 2,
2760                 description   => "",
2761             },
2762             {   actual_passed => TRUE,
2763                 is_actual_ok  => TRUE,
2764                 passed        => TRUE,
2765                 is_ok         => TRUE,
2766                 is_test       => TRUE,
2767                 has_skip      => FALSE,
2768                 has_todo      => FALSE,
2769                 number        => 3,
2770                 description   => "",
2771             },
2772             {   actual_passed => TRUE,
2773                 is_actual_ok  => TRUE,
2774                 passed        => TRUE,
2775                 is_ok         => TRUE,
2776                 is_test       => TRUE,
2777                 has_skip      => FALSE,
2778                 has_todo      => FALSE,
2779                 number        => 4,
2780                 description   => "",
2781             },
2782             {   actual_passed => TRUE,
2783                 is_actual_ok  => TRUE,
2784                 passed        => TRUE,
2785                 is_ok         => TRUE,
2786                 is_test       => TRUE,
2787                 has_skip      => FALSE,
2788                 has_todo      => FALSE,
2789                 number        => 5,
2790                 description   => "",
2791             },
2792         ],
2793         plan          => '1..5',
2794         passed        => [ 1 .. 5 ],
2795         actual_passed => [ 1 .. 5 ],
2796         failed        => [],
2797         actual_failed => [],
2798         todo          => [],
2799         todo_passed   => [],
2800         skipped       => [],
2801         good_plan     => TRUE,
2802         is_good_plan  => TRUE,
2803         tests_planned => 5,
2804         tests_run     => 5,
2805         parse_errors =>
2806           [ 'Explicit TAP version must be at least 13. Got version 12' ],
2807         'exit'  => 0,
2808         wait    => 0,
2809         version => 12,
2810     },
2811     version_late => {
2812         results => [
2813             {   is_plan       => TRUE,
2814                 raw           => '1..5',
2815                 tests_planned => 5,
2816                 passed        => TRUE,
2817                 is_ok         => TRUE,
2818             },
2819             {   is_version => TRUE,
2820                 raw        => 'TAP version 13',
2821             },
2822             {   actual_passed => TRUE,
2823                 is_actual_ok  => TRUE,
2824                 passed        => TRUE,
2825                 is_ok         => TRUE,
2826                 is_test       => TRUE,
2827                 has_skip      => FALSE,
2828                 has_todo      => FALSE,
2829                 number        => 1,
2830                 description   => "",
2831             },
2832             {   actual_passed => TRUE,
2833                 is_actual_ok  => TRUE,
2834                 passed        => TRUE,
2835                 is_ok         => TRUE,
2836                 is_test       => TRUE,
2837                 has_skip      => FALSE,
2838                 has_todo      => FALSE,
2839                 number        => 2,
2840                 description   => "",
2841             },
2842             {   actual_passed => TRUE,
2843                 is_actual_ok  => TRUE,
2844                 passed        => TRUE,
2845                 is_ok         => TRUE,
2846                 is_test       => TRUE,
2847                 has_skip      => FALSE,
2848                 has_todo      => FALSE,
2849                 number        => 3,
2850                 description   => "",
2851             },
2852             {   actual_passed => TRUE,
2853                 is_actual_ok  => TRUE,
2854                 passed        => TRUE,
2855                 is_ok         => TRUE,
2856                 is_test       => TRUE,
2857                 has_skip      => FALSE,
2858                 has_todo      => FALSE,
2859                 number        => 4,
2860                 description   => "",
2861             },
2862             {   actual_passed => TRUE,
2863                 is_actual_ok  => TRUE,
2864                 passed        => TRUE,
2865                 is_ok         => TRUE,
2866                 is_test       => TRUE,
2867                 has_skip      => FALSE,
2868                 has_todo      => FALSE,
2869                 number        => 5,
2870                 description   => "",
2871             },
2872         ],
2873         plan          => '1..5',
2874         passed        => [ 1 .. 5 ],
2875         actual_passed => [ 1 .. 5 ],
2876         failed        => [],
2877         actual_failed => [],
2878         todo          => [],
2879         todo_passed   => [],
2880         skipped       => [],
2881         good_plan     => TRUE,
2882         is_good_plan  => TRUE,
2883         tests_planned => 5,
2884         tests_run     => 5,
2885         parse_errors =>
2886           [ 'If TAP version is present it must be the first line of output' ],
2887         'exit'  => 0,
2888         wait    => 0,
2889         version => 12,
2890     },
2891
2892     escape_eol => {
2893         results => [
2894             {   is_plan       => TRUE,
2895                 raw           => '1..2',
2896                 tests_planned => 2,
2897                 passed        => TRUE,
2898                 is_ok         => TRUE,
2899             },
2900             {   actual_passed => TRUE,
2901                 is_actual_ok  => TRUE,
2902                 description =>
2903                   'Should parse as literal backslash --> \\',
2904                 passed       => TRUE,
2905                 is_ok        => TRUE,
2906                 is_test      => TRUE,
2907                 has_skip     => FALSE,
2908                 has_todo     => FALSE,
2909                 number       => 1,
2910                 is_unplanned => FALSE,
2911             },
2912             {   actual_passed => TRUE,
2913                 is_actual_ok  => TRUE,
2914                 passed        => TRUE,
2915                 is_ok         => TRUE,
2916                 is_test       => TRUE,
2917                 has_skip      => FALSE,
2918                 has_todo      => FALSE,
2919                 number        => 2,
2920                 description   => 'Not a continuation line',
2921                 is_unplanned  => FALSE,
2922             },
2923         ],
2924         plan          => '1..2',
2925         passed        => [ 1 .. 2 ],
2926         actual_passed => [ 1 .. 2 ],
2927         failed        => [],
2928         actual_failed => [],
2929         todo          => [],
2930         todo_passed   => [],
2931         skipped       => [],
2932         good_plan     => TRUE,
2933         is_good_plan  => TRUE,
2934         tests_planned => 2,
2935         tests_run     => 2,
2936         parse_errors  => [],
2937         'exit'        => 0,
2938         wait          => 0,
2939         version       => 12,
2940     },
2941
2942     escape_hash => {
2943         results => [
2944             {   is_plan       => TRUE,
2945                 raw           => '1..3',
2946                 tests_planned => 3,
2947                 passed        => TRUE,
2948                 is_ok         => TRUE,
2949             },
2950             {   actual_passed => TRUE,
2951                 is_actual_ok  => TRUE,
2952                 description   => 'Not a \\# TODO',
2953                 passed        => TRUE,
2954                 is_ok         => TRUE,
2955                 is_test       => TRUE,
2956                 has_skip      => FALSE,
2957                 has_todo      => FALSE,
2958                 number        => 1,
2959                 is_unplanned  => FALSE,
2960             },
2961             {   actual_passed => TRUE,
2962                 is_actual_ok  => TRUE,
2963                 passed        => TRUE,
2964                 is_ok         => TRUE,
2965                 is_test       => TRUE,
2966                 has_skip      => FALSE,
2967                 has_todo      => FALSE,
2968                 number        => 2,
2969                 description   => 'Not a \\# SKIP',
2970                 is_unplanned  => FALSE,
2971             },
2972             {   actual_passed => TRUE,
2973                 is_actual_ok  => TRUE,
2974                 passed        => TRUE,
2975                 is_ok         => TRUE,
2976                 is_test       => TRUE,
2977                 has_skip      => FALSE,
2978                 has_todo      => FALSE,
2979                 number        => 3,
2980                 description   => 'Escaped \\\\\\#',
2981                 is_unplanned  => FALSE,
2982             },
2983         ],
2984         plan          => '1..3',
2985         passed        => [ 1 .. 3 ],
2986         actual_passed => [ 1 .. 3 ],
2987         failed        => [],
2988         actual_failed => [],
2989         todo          => [],
2990         todo_passed   => [],
2991         skipped       => [],
2992         good_plan     => TRUE,
2993         is_good_plan  => TRUE,
2994         tests_planned => 3,
2995         tests_run     => 3,
2996         parse_errors  => [],
2997         'exit'        => 0,
2998         wait          => 0,
2999         version       => 12,
3000     },
3001 );
3002
3003 my %HANDLER_FOR = (
3004     NOT_ZERO, sub { local $^W; 0 != shift },
3005     TRUE,     sub { local $^W; !!shift },
3006     FALSE,    sub { local $^W; !shift },
3007 );
3008
3009 my $can_open3 = ( $Config{d_fork} || $IsWin32 ) ? 1 : 0;
3010
3011 for my $hide_fork ( 0 .. $can_open3 ) {
3012     if ($hide_fork) {
3013         no strict 'refs';
3014         local $^W = 0;
3015         *{'TAP::Parser::Iterator::Process::_use_open3'} = sub {return};
3016     }
3017
3018     TEST:
3019     for my $test ( sort keys %samples ) {
3020
3021         #next unless 'empty' eq $test;
3022         my %details = %{ $samples{$test} };
3023
3024         if ( my $skip_if = delete $details{skip_if} ) {
3025             next TEST if $skip_if->();
3026         }
3027
3028         my $results    = delete $details{results};
3029         my $args       = delete $details{__ARGS__};
3030         my $need_open3 = delete $details{need_open3};
3031
3032         next TEST if $need_open3 && ( $hide_fork || !$can_open3 );
3033
3034         # the following acrobatics are necessary to make it easy for the
3035         # Test::Builder::failure_output() method to be overridden when
3036         # TAP::Parser is not installed.  Otherwise, these tests will fail.
3037
3038         unshift @{ $args->{switches} },
3039           $ENV{PERL_CORE} ? ( map {"-I$_"} @INC ) : ('-It/lib');
3040
3041         $args->{source} = File::Spec->catfile( $SAMPLE_TESTS, $test );
3042         $args->{merge} = !$hide_fork;
3043
3044         my $parser = eval { analyze_test( $test, [@$results], $args ) };
3045         my $error = $@;
3046         ok !$error, "'$test' should parse successfully"
3047           or diag $error;
3048
3049         if ($error) {
3050             my $tests = 0;
3051             while ( my ( $method, $answer ) = each %details ) {
3052                 $tests += ref $answer ? 2 : 1;
3053             }
3054             SKIP: {
3055                 skip "$test did not parse successfully", $tests;
3056             }
3057         }
3058         else {
3059             while ( my ( $method, $answer ) = each %details ) {
3060                 if ( my $handler = $HANDLER_FOR{ $answer || '' } ) {    # yuck
3061                     ok $handler->( $parser->$method() ),
3062                       "... and $method should return a reasonable value ($test)";
3063                 }
3064                 elsif ( !ref $answer ) {
3065                     local $^W;    # uninit warnings
3066
3067                     $answer = _vmsify_answer( $method, $answer );
3068
3069                     is $parser->$method(), $answer,
3070                       "... and $method should equal $answer ($test)";
3071                 }
3072                 else {
3073                     is scalar $parser->$method(), scalar @$answer,
3074                       "... and $method should be the correct amount ($test)";
3075                     is_deeply [ $parser->$method() ], $answer,
3076                       "... and $method should be the correct values ($test)";
3077                 }
3078             }
3079         }
3080     }
3081 }
3082
3083 my %Unix2VMS_Exit_Codes = ( 1 => 4, );
3084
3085 sub _vmsify_answer {
3086     my ( $method, $answer ) = @_;
3087
3088     return $answer unless $IsVMS;
3089
3090     if ( $method eq 'exit'
3091         and exists $Unix2VMS_Exit_Codes{$answer} )
3092     {
3093         $answer = $Unix2VMS_Exit_Codes{$answer};
3094     }
3095
3096     return $answer;
3097 }
3098
3099 sub analyze_test {
3100     my ( $test, $results, $args ) = @_;
3101
3102     my $parser = TAP::Parser->new($args);
3103     my $count  = 1;
3104     while ( defined( my $result = $parser->next ) ) {
3105
3106         my $expected = shift @$results;
3107         my $desc
3108           = $result->is_test
3109           ? $result->description
3110           : $result->raw;
3111         $desc = $result->plan
3112           if $result->is_plan && $desc =~ /SKIP/i;
3113         $desc =~ s/#/<hash>/g;
3114         $desc =~ s/\s+/ /g;      # Drop newlines
3115         ok defined $expected,
3116           "$test/$count We should have a result for $desc";
3117         while ( my ( $method, $answer ) = each %$expected ) {
3118
3119             if ( my $handler = $HANDLER_FOR{ $answer || '' } ) {    # yuck
3120                 ok $handler->( $result->$method() ),
3121                   "... and $method should return a reasonable value ($test/$count)";
3122             }
3123             elsif ( ref $answer ) {
3124                 is_deeply $result->$method(), $answer,
3125                   "... and $method should return the correct structure ($test/$count)";
3126             }
3127             else {
3128                 is $result->$method(), $answer,
3129                   "... and $method should return the correct answer ($test/$count)";
3130             }
3131         }
3132         $count++;
3133     }
3134     is @$results, 0,
3135       "... and we should have the correct number of results ($test)";
3136     return $parser;
3137 }
3138
3139 # vms_nit