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