summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-02-24 18:46:51 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-02-24 18:46:51 +0000
commit14fb125dad9cd9086d001ea5a206ec3c9897a5c0 (patch)
treeaea97c1f97426c241fffef7149e033910257118d /t
parent4411f3b60960504e67715e05eb0ed3192bfff8fc (diff)
parentb485d0510a038735eb089728415ee23b7dc90a29 (diff)
downloadperl-14fb125dad9cd9086d001ea5a206ec3c9897a5c0.tar.gz
Integrate mainline - to see what Jarkko has in ...
p4raw-id: //depot/perlio@8924
Diffstat (limited to 't')
-rwxr-xr-xt/TEST2
-rwxr-xr-xt/lib/glob-basic.t8
-rwxr-xr-xt/op/pat.t23
-rw-r--r--t/pod/find.t76
-rw-r--r--t/pod/testpods/lib/Pod/Stuff.pm20
5 files changed, 89 insertions, 40 deletions
diff --git a/t/TEST b/t/TEST
index 98d5fe3c17..bccf63bd44 100755
--- a/t/TEST
+++ b/t/TEST
@@ -27,7 +27,7 @@ $ENV{EMXSHELL} = 'sh'; # For OS/2
if ($#ARGV == -1) {
@ARGV = split(/[ \n]/,
- `echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`);
+ `echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t pod/*.t`);
}
%infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 );
diff --git a/t/lib/glob-basic.t b/t/lib/glob-basic.t
index 5094ff6aa1..25edde32f2 100755
--- a/t/lib/glob-basic.t
+++ b/t/lib/glob-basic.t
@@ -102,9 +102,11 @@ print "ok 7\n";
GLOB_BRACE | GLOB_NOMAGIC | ($^O eq 'VMS' ? GLOB_NOCASE : 0)
);
-# Working on t/TEST often causes this test to fail because it sees temp
-# and RCS files. Filter them out, and .pm files too.
-@a = grep !/(,v$|~$|\.pm$)/, @a;
+# Working on t/TEST often causes this test to fail because it sees Emacs temp
+# and RCS files. Filter them out, and .pm files too, and patch temp files.
+@a = grep !/(,v$|~$|\.(pm|ori?g|rej)$)/, @a;
+
+print "# @a\n";
unless (@a == 3
and $a[0] eq ($^O eq 'VMS'? 'test.' : 'TEST')
diff --git a/t/op/pat.t b/t/op/pat.t
index d7eb9f8fd1..237ea44c4e 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -4,7 +4,7 @@
# the format supported by op/regexp.t. If you want to add a test
# that does fit that format, add it to op/re_tests, not here.
-print "1..240\n";
+print "1..242\n";
BEGIN {
chdir 't' if -d 't';
@@ -1182,3 +1182,24 @@ if (/(\C)/g) {
print "not ok $_\n";
}
}
+
+# 241..242
+#
+# The tr is admittedly NOT a regular expression operator,
+# but this test is more of an EBCDIC test, the background is
+# that \x89 is 'i' and \x90 is 'j', and \x8e is not a letter,
+# not even a printable character. Now for the trick:
+# if the range is specified using letters, the \x8e should most
+# probably not match, but if the range is specified using explicit
+# numeric endpoints, it probably should match. The first case,
+# not matching if using letters, is already tested elsewhere,
+# here we test for the matching cases.
+
+$_ = qq/\x8E/;
+
+print "not " unless /[\x89-\x91]/;
+print "ok 241\n";
+
+print "not " unless tr/\x89-\x91//d == 1;
+print "ok 242\n";
+
diff --git a/t/pod/find.t b/t/pod/find.t
index f5d4c526b9..3a0b274563 100644
--- a/t/pod/find.t
+++ b/t/pod/find.t
@@ -5,40 +5,56 @@ $| = 1;
use Test;
-BEGIN { plan tests => 4 }
+BEGIN {
+ plan tests => 4;
+ use File::Spec;
+ if ($^O eq 'VMS') {
+ # This magick is needed to make the VMS I/O system to believe
+ # that there's life after eight directory levels (this makes
+ # it believe there's life until sixteen levels). The filesystem
+ # has no limitation as such.
+ $DEFAULT_DIR = $ENV{'DEFAULT'};
+ my $here = $DEFAULT_DIR;
+ my ($dev,$dir) = File::Spec->splitpath($here);
+ $dev =~ s/:$//;
+ $dev = $ENV{$dev} if exists($ENV{$dev});
+ $dev .= ':' if $dev !~ /:/;
+ $here = File::Spec->canonpath($dev.$dir);
+ $here =~ s/\]$/.]/;
+ system "define/nolog/job/trans=conceal temp_perl_base $here";
+ chdir('temp_perl_base:[000000]');
+ }
+}
+
+END {
+ chdir($DEFAULT_DIR) if $^O eq 'VMS';
+ system "deassign/job temp_perl_base";
+}
use Pod::Find qw(pod_find pod_where);
-use File::Spec;
# load successful
ok(1);
require Cwd;
-my $THISDIR = Cwd::cwd();
my $VERBOSE = 0;
-my $lib_dir = File::Spec->catdir($THISDIR,'lib');
+my $lib_dir = File::Spec->catdir('pod', 'testpods', 'lib');
if ($^O eq 'VMS') {
- $lib_dir = VMS::Filespec::unixify(File::Spec->catdir($THISDIR,'-','lib','pod'));
+ $lib_dir = VMS::Filespec::unixify(File::Spec->catdir('pod', 'testpods', 'lib'));
$Qlib_dir = $lib_dir;
$Qlib_dir =~ s#\/#::#g;
}
print "### searching $lib_dir\n";
-my %pods = pod_find("$lib_dir");
-my $result = join("\n### ", sort values %pods);
-print "### found $result\n";
-my $compare = join(',', qw(
- Pod::Checker
- Pod::Find
- Pod::InputObjects
- Pod::ParseUtils
- Pod::Parser
- Pod::PlainText
- Pod::Select
- Pod::Usage
+my %pods = pod_find($lib_dir);
+my $result = join(',', sort values %pods);
+my $compare = join(',', sort qw(
+ Pod::Stuff
+ Pod::Rhubarb
+ Like::And::Yeah
));
if ($^O eq 'VMS') {
$compare = lc($compare);
- $result = join(',', sort grep(/pod::/, values %pods));
+ $result = join(',', sort values %pods);
my $undollared = $Qlib_dir;
$undollared =~ s/\$/\\\$/g;
$undollared =~ s/\-/\\\-/g;
@@ -55,8 +71,6 @@ else {
ok($result,$compare);
}
-# File::Find is located in this place since eons
-# and on all platforms, hopefully
print "### searching for File::Find\n";
$result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'File::Find')
@@ -71,27 +85,19 @@ if ($^O eq 'VMS') { # privlib is perl_root:[lib] OK but not under mms
ok($result,$compare);
}
else {
- $compare = File::Spec->catfile($Config::Config{privlib},"File","Find.pm");
+ $compare = File::Spec->catfile(File::Spec->updir, 'lib','File','Find.pm');
ok(_canon($result),_canon($compare));
}
# Search for a documentation pod rather than a module
-print "### searching for perlfunc.pod\n";
-$result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'perlfunc')
- || 'undef - perlfunc.pod not found!';
+print "### searching for Stuff.pod\n";
+my $search = File::Spec->catdir('pod', 'testpods', 'lib', 'Pod');
+$result = pod_where({ -dirs => [$search], -verbose => $VERBOSE }, 'Stuff')
+ || 'undef - Stuff.pod not found!';
print "### found $result\n";
-if ($^O eq 'VMS') { # privlib is perl_root:[lib] unfortunately
- $compare = "/lib/pod/perlfunc.pod";
- $result = VMS::Filespec::unixify($result);
- $result =~ s/perl_root\///i;
- $result =~ s/^\.\.//; # needed under `mms test`
- ok($result,$compare);
-}
-else {
- $compare = File::Spec->catfile($Config::Config{privlib},"perlfunc.pod");
- ok(_canon($result),_canon($compare));
-}
+$compare = File::Spec->catfile('pod', 'testpods', 'lib', 'Pod' ,'Stuff.pod');
+ok(_canon($result),_canon($compare));
# make the path as generic as possible
sub _canon
diff --git a/t/pod/testpods/lib/Pod/Stuff.pm b/t/pod/testpods/lib/Pod/Stuff.pm
new file mode 100644
index 0000000000..d5c1120303
--- /dev/null
+++ b/t/pod/testpods/lib/Pod/Stuff.pm
@@ -0,0 +1,20 @@
+=head1 NAME
+
+Pod::Stuff - dummy testing pod
+
+=head1 DESCRIPTION
+
+This isn't really anything, its just some dummy pod code.
+And stuff.
+
+Lots of stuff.
+
+=head2 STUFF
+
+For all your stuff [tm]
+
+Stuffit
+
+Mmmm, stuffed pizza bread.
+
+=cut