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