File: pmtools.t

package info (click to toggle)
pmtools 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 388 kB
  • sloc: perl: 803; makefile: 10
file content (26 lines) | stat: -rw-r--r-- 751 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# pmtools testing

# ------ pragmas
use strict;
use warnings;
use pmtools;
use Test::More tests => 7;

# ------ define variable
my $output = undef;	# output from pmtools

my $iter = pmtools::new_pod_iterator('quux');
is(ref $iter, 'CODE', 'created a pmtools iterator');
is($iter->(), "$INC[0]/pod/quux.pod", "first POD file, first \@INC");
is($iter->(), "$INC[0]/quux.pod",     "middle POD file, first \@INC");
is($iter->(), "$INC[0]/quux.pm",      "last POD file, first \@INC");

my $old_pod_file;
my $pod_file;
while ($pod_file = $iter->()) {
    $old_pod_file = $pod_file;
}
is($old_pod_file, "$INC[$#INC]/quux.pm", 'last POD file, last @INC');

is($pod_file, undef, 'beyond end of filenames');
is($iter->(), undef, 'way beyond end of filenames');