| 1 | # pmtools testing |
| 2 | |
| 3 | # ------ pragmas |
| 4 | use strictscip-perl cpan pmtools 2.2.0 strict/; |
| 5 | use warningsscip-perl cpan pmtools 2.2.0 warnings/; |
| 6 | use pmtoolsscip-perl cpan pmtools 2.2.0 pmtools/; |
| 7 | use Test::Morescip-perl cpan pmtools 2.2.0 Test/More/ tests => 7; |
| 8 | |
| 9 | # ------ define variable |
| 10 | my $output = undef; # output from pmtools |
| 11 | |
| 12 | my $iter = pmtools::new_pod_iteratorscip-perl cpan pmtools 2.2.0 pmtools/new_pod_iterator().('quux'); |
| 13 | isscip-perl cpan pmtools 2.2.0 main/is().(refscip-perl cpan pmtools 2.2.0 main/ref(). $iter, 'CODE', 'created a pmtools iterator'); |
| 14 | isscip-perl cpan pmtools 2.2.0 main/is().($iter->()scip-perl cpan pmtools 2.2.0 main/`->()`()., "$INC[0]/pod/quux.pod", "first POD file, first \@INC"); |
| 15 | isscip-perl cpan pmtools 2.2.0 main/is().($iter->()scip-perl cpan pmtools 2.2.0 main/`->()`()., "$INC[0]/quux.pod", "middle POD file, first \@INC"); |
| 16 | isscip-perl cpan pmtools 2.2.0 main/is().($iter->()scip-perl cpan pmtools 2.2.0 main/`->()`()., "$INC[0]/quux.pm", "last POD file, first \@INC"); |
| 17 | |
| 18 | my $old_pod_file; |
| 19 | my $pod_file; |
| 20 | while ($pod_file = $iter->()scip-perl cpan pmtools 2.2.0 main/`->()`().) { |
| 21 | $old_pod_file = $pod_file; |
| 22 | } |
| 23 | isscip-perl cpan pmtools 2.2.0 main/is().($old_pod_file, "$INC[$#INC]/quux.pm", 'last POD file, last @INC'); |
| 24 | |
| 25 | isscip-perl cpan pmtools 2.2.0 main/is().($pod_file, undef, 'beyond end of filenames'); |
| 26 | isscip-perl cpan pmtools 2.2.0 main/is().($iter->()scip-perl cpan pmtools 2.2.0 main/`->()`()., undef, 'way beyond end of filenames'); |