Upgrade to Pod-Parser-1.34 (with some changes to get the new test file
authorSteve Peters <steve@fisharerojo.org>
Sun, 16 Oct 2005 13:02:19 +0000 (13:02 +0000)
committerSteve Peters <steve@fisharerojo.org>
Sun, 16 Oct 2005 13:02:19 +0000 (13:02 +0000)
       to work within the core).

p4raw-id: //depot/perl@25765

MANIFEST
lib/Pod/Find.pm
lib/Pod/t/contains_pod.t [new file with mode: 0644]
t/lib/contains_pod.xr [new file with mode: 0644]

index 28d5296..efaa36c 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1891,6 +1891,7 @@ lib/Pod/t/basic.ovr               podlators test
 lib/Pod/t/basic.pod            podlators test
 lib/Pod/t/basic.t              podlators test
 lib/Pod/t/basic.txt            podlators test
+lib/Pod/t/contains_pod.t       Pod-Parser test
 lib/Pod/t/eol.t                        end of line agnosticism
 lib/Pod/Text/Color.pm          Convert POD data to color ASCII text
 lib/Pod/Text/Overstrike.pm     Convert POD data to formatted overstrike text
@@ -2731,6 +2732,7 @@ t/japh/abigail.t          Obscure tests
 t/lib/1_compile.t              See if the various libraries and extensions compile
 t/lib/commonsense.t            See if configuration meets basic needs
 t/lib/compmod.pl               Helper for 1_compile.t
+t/lib/contains_pod.xr          Pod-Parser test file
 t/lib/cygwin.t                 Builtin cygwin function tests
 t/lib/Devel/switchd.pm         Module for t/run/switchd.t
 t/lib/Dev/Null.pm              Module for testing Test::Harness
index 7911a55..0b085b8 100644 (file)
@@ -13,7 +13,7 @@
 package Pod::Find;
 
 use vars qw($VERSION);
-$VERSION = 1.30;   ## Current version of this package
+$VERSION = 1.34;   ## Current version of this package
 require  5.005;   ## requires this Perl version or later
 use Carp;
 
@@ -251,7 +251,7 @@ sub _check_and_extract_name {
 
     # check extension or executable flag
     # this involves testing the .bat extension on Win32!
-    unless(-f $file && -T _ && ($file =~ /\.(pod|pm|plx?)\z/i || -x _ )) {
+    unless(-f $file && -T $file && ($file =~ /\.(pod|pm|plx?)\z/i || -x $file )) {
       return undef;
     }
 
@@ -494,7 +494,7 @@ sub contains_pod {
   local $/ = undef;
   my $pod = <POD>;
   close(POD) || die "Error closing $file: $!\n";
-  unless($pod =~ /\n=(head\d|pod|over|item)\b/s) {
+  unless($pod =~ /^=(head\d|pod|over|item)\b/m) {
     warn "No POD in $file, skipping.\n"
       if($verbose);
     return 0;
diff --git a/lib/Pod/t/contains_pod.t b/lib/Pod/t/contains_pod.t
new file mode 100644 (file)
index 0000000..9ebe665
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/env perl
+
+# Copyright (C) 2005  Joshua Hoblitt
+#
+# $Id$
+
+use strict;
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    } else {
+        use lib qw( ./lib );
+    }
+}
+
+
+use Test::More tests => 1;
+
+use Pod::Find qw( contains_pod );
+
+{
+    ok(contains_pod('lib/contains_pod.xr'), "contains pod");
+}
diff --git a/t/lib/contains_pod.xr b/t/lib/contains_pod.xr
new file mode 100644 (file)
index 0000000..7ea408d
--- /dev/null
@@ -0,0 +1,5 @@
+=head1 foo
+
+bar baz.
+
+=cut