From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Sun, 8 Apr 2001 20:07:11 +0000 (+0000)
Subject: Integrate change #9624 from maintperl into mainline:
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dbd1b0a240e81742f12d4fa9574cf883a061b223;p=p5sagit%2Fp5-mst-13.2.git

Integrate change #9624 from maintperl into mainline:
the pod tests were not okay.  (t/pod/find.t changes ignored)

p4raw-link: @9624 on //depot/maint-5.6/perl: cf1c4a97376b5a495969381e18662a86af89c73a

p4raw-id: //depot/perl@9643
p4raw-integrated: from //depot/maint-5.6/perl@9642 'copy in'
	t/pod/emptycmd.t t/pod/for.t t/pod/headings.t t/pod/include.t
	t/pod/included.t t/pod/lref.t t/pod/multiline_items.t
	t/pod/nested_items.t t/pod/nested_seqs.t t/pod/oneline_cmds.t
	t/pod/pod2usage.t t/pod/poderrs.t t/pod/podselect.t (@7885..)
	t/pod/special_seqs.t (@7893..) 'merge in' lib/Pod/Find.pm
	(@8727..)
---

diff --git a/lib/Pod/Find.pm b/lib/Pod/Find.pm
index 759cd3d..6e5f570 100644
--- a/lib/Pod/Find.pm
+++ b/lib/Pod/Find.pm
@@ -145,7 +145,7 @@ sub pod_find
         # * remove e.g. 5.00503
         # * remove pod/ if followed by *.pod (e.g. in pod/perlfunc.pod)
         $SIMPLIFY_RX =
-          qq!^(?i:site_perl/|\Q$Config::Config{archname}\E/|\\d+\\.\\d+([_.]?\\d+)?/|pod/(?=.*?\\.pod\\z))*!;
+          qq!^(?i:site(_perl)?/|\Q$Config::Config{archname}\E/|\\d+\\.\\d+([_.]?\\d+)?/|pod/(?=.*?\\.pod\\z))*!;
 
     }
 
@@ -262,7 +262,7 @@ sub _simplify {
     # strip Perl's own extensions
     $_[0] =~ s/\.(pod|pm|plx?)\z//i;
     # strip meaningless extensions on Win32 and OS/2
-    $_[0] =~ s/\.(bat|exe|cmd)\z//i if($^O =~ /win|os2/i);
+    $_[0] =~ s/\.(bat|exe|cmd)\z//i if($^O =~ /mswin|os2/i);
     # strip meaningless extensions on VMS
     $_[0] =~ s/\.(com)\z//i if($^O eq 'VMS');
 }
diff --git a/t/pod/emptycmd.t b/t/pod/emptycmd.t
index 59e395e..815eba2 100755
--- a/t/pod/emptycmd.t
+++ b/t/pod/emptycmd.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/for.t b/t/pod/for.t
index 44af44f..4af528a 100755
--- a/t/pod/for.t
+++ b/t/pod/for.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/headings.t b/t/pod/headings.t
index 78608d0..365aa7d 100755
--- a/t/pod/headings.t
+++ b/t/pod/headings.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/include.t b/t/pod/include.t
index 4e73b78..b6f1e31 100755
--- a/t/pod/include.t
+++ b/t/pod/include.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/included.t b/t/pod/included.t
index 4f171c4..a25b37b 100755
--- a/t/pod/included.t
+++ b/t/pod/included.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/lref.t b/t/pod/lref.t
index 02e2c9e..1dd8c68 100755
--- a/t/pod/lref.t
+++ b/t/pod/lref.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/multiline_items.t b/t/pod/multiline_items.t
index 0fe410a..334832d 100755
--- a/t/pod/multiline_items.t
+++ b/t/pod/multiline_items.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/nested_items.t b/t/pod/nested_items.t
index c8e9b22..0b86702 100755
--- a/t/pod/nested_items.t
+++ b/t/pod/nested_items.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/nested_seqs.t b/t/pod/nested_seqs.t
index 8559f1f..9f30533 100755
--- a/t/pod/nested_seqs.t
+++ b/t/pod/nested_seqs.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/oneline_cmds.t b/t/pod/oneline_cmds.t
index 28bd1d0..bba0e4a 100755
--- a/t/pod/oneline_cmds.t
+++ b/t/pod/oneline_cmds.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/pod2usage.t b/t/pod/pod2usage.t
index cf2c31b..70cbacd 100755
--- a/t/pod/pod2usage.t
+++ b/t/pod/pod2usage.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/poderrs.t b/t/pod/poderrs.t
index 8db7d43..1b92ede 100755
--- a/t/pod/poderrs.t
+++ b/t/pod/poderrs.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testpchk.pl";
    import TestPodChecker;
 }
diff --git a/t/pod/podselect.t b/t/pod/podselect.t
index 0004548..5d45cdb 100755
--- a/t/pod/podselect.t
+++ b/t/pod/podselect.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }
diff --git a/t/pod/special_seqs.t b/t/pod/special_seqs.t
index ecd99ec..c6b2ce1 100755
--- a/t/pod/special_seqs.t
+++ b/t/pod/special_seqs.t
@@ -1,7 +1,7 @@
 BEGIN {
-   use File::Basename;
-   my $THISDIR = dirname $0;
-   unshift @INC, $THISDIR;
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   unshift @INC, './pod';
    require "testp2pt.pl";
    import TestPodIncPlainText;
 }