This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Bring the joy of strict and warnings to Functions.t
authorNicholas Clark <nick@ccl4.org>
Sun, 29 Jan 2012 12:23:31 +0000 (12:23 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 18 Feb 2012 12:16:51 +0000 (13:16 +0100)
This reveals that use_ok() was not in a BEGIN block, and in turn that the
test count needs to be declared before this BEGIN block runs. Now fixed.

lib/Pod/t/Functions.t

index ec74b43..fb6dc40 100644 (file)
@@ -1,18 +1,20 @@
-#!perl
+#!perl -w
 
 BEGIN {
        chdir 't' if -d 't';
        @INC = '../lib';
 }
 
+use strict;
+
 use File::Basename;
 use File::Spec;
 
-use Test::More;
-plan tests => 9;
-
+use Test::More tests => 9;
 
-use_ok( 'Pod::Functions' );
+BEGIN {
+    use_ok( 'Pod::Functions' );
+}
 
 # How do you test exported vars?
 my( $pkg_ref, $exp_ref ) = ( \%Pod::Functions::Kinds, \%Kinds );