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