Subject: | [PATCH] Enforce strict and warnings in test suite |
Make sure tests are run with strict and warnings enabled.
This allows to detect issues earlier during development cycle.
Changes can be view online at: https://github.com/atoomic/Pod-Usage/pull/1/files
You can view a CI workflow with these changes on top of v1.70 from:
https://github.com/atoomic/Pod-Usage/actions/runs/213888280
Subject: | 0001-Enforce-strict-and-warnings-in-test.patch |
From 4381b37a4347af50e9c0ce4c2bc1d2746fc46ab2 Mon Sep 17 00:00:00 2001
From: Nicolas R <nicolas@atoomic.org>
Date: Tue, 18 Aug 2020 10:08:08 -0600
Subject: [PATCH] Enforce strict and warnings in test
---
t/inc/Pod/InputObjects.pm | 1 +
t/inc/Pod/Parser.pm | 1 +
t/inc/Pod/PlainText.pm | 1 +
t/inc/Pod/Select.pm | 1 +
t/pod/headwithmarkup.t | 3 +++
t/pod/p2u_data.pl | 3 +++
t/pod/pod2usage.t | 3 +++
t/pod/pod2usage2.t | 1 +
t/pod/selectheaders.pl | 1 +
t/pod/selectheaders.t | 3 +++
t/pod/selectsections.pl | 3 +++
t/pod/selectsections.t | 3 +++
12 files changed, 24 insertions(+)
diff --git a/t/inc/Pod/InputObjects.pm b/t/inc/Pod/InputObjects.pm
index c19d4c5..2b9b6e5 100644
--- a/t/inc/Pod/InputObjects.pm
+++ b/t/inc/Pod/InputObjects.pm
@@ -10,6 +10,7 @@
package Pod::InputObjects;
use strict;
+use warnings;
use vars qw($VERSION);
$VERSION = '1.60'; ## Current version of this package
diff --git a/t/inc/Pod/Parser.pm b/t/inc/Pod/Parser.pm
index 4b4fecf..c0e1804 100644
--- a/t/inc/Pod/Parser.pm
+++ b/t/inc/Pod/Parser.pm
@@ -9,6 +9,7 @@
package Pod::Parser;
use strict;
+use warnings;
## These "variables" are used as local "glob aliases" for performance
use vars qw($VERSION @ISA %myData %myOpts @input_stack);
diff --git a/t/inc/Pod/PlainText.pm b/t/inc/Pod/PlainText.pm
index e8dc001..106b363 100644
--- a/t/inc/Pod/PlainText.pm
+++ b/t/inc/Pod/PlainText.pm
@@ -17,6 +17,7 @@
package Pod::PlainText;
use strict;
+use warnings;
require 5.005;
diff --git a/t/inc/Pod/Select.pm b/t/inc/Pod/Select.pm
index 148b5d1..0830cc8 100644
--- a/t/inc/Pod/Select.pm
+++ b/t/inc/Pod/Select.pm
@@ -9,6 +9,7 @@
package Pod::Select;
use strict;
+use warnings;
use vars qw($VERSION @ISA @EXPORT $MAX_HEADING_LEVEL %myData @section_headings @selected_sections);
$VERSION = '1.60'; ## Current version of this package
diff --git a/t/pod/headwithmarkup.t b/t/pod/headwithmarkup.t
index adba2be..ef745d1 100644
--- a/t/pod/headwithmarkup.t
+++ b/t/pod/headwithmarkup.t
@@ -1,5 +1,8 @@
use Test::More tests => 1;
+use strict;
+use warnings;
+
my $blib = $ENV{PERL_CORE} ? '-I../../lib' : '-Mblib';
my $pl = $0;
diff --git a/t/pod/p2u_data.pl b/t/pod/p2u_data.pl
index ec0e3a7..4569043 100644
--- a/t/pod/p2u_data.pl
+++ b/t/pod/p2u_data.pl
@@ -1,4 +1,7 @@
use Pod::Usage;
+use strict;
+use warnings;
+
pod2usage(-verbose => 2, -exit => 17, -input => \*DATA);
__DATA__
diff --git a/t/pod/pod2usage.t b/t/pod/pod2usage.t
index cf2c31b..921121a 100644
--- a/t/pod/pod2usage.t
+++ b/t/pod/pod2usage.t
@@ -1,3 +1,6 @@
+use strict;
+use warnings;
+
BEGIN {
use File::Basename;
my $THISDIR = dirname $0;
diff --git a/t/pod/pod2usage2.t b/t/pod/pod2usage2.t
index a6552c5..5ab9090 100644
--- a/t/pod/pod2usage2.t
+++ b/t/pod/pod2usage2.t
@@ -2,6 +2,7 @@
use Test::More;
use strict;
+use warnings;
BEGIN {
if ($^O eq 'MSWin32' || $^O eq 'VMS') {
diff --git a/t/pod/selectheaders.pl b/t/pod/selectheaders.pl
index d0b557f..1fd6a7f 100644
--- a/t/pod/selectheaders.pl
+++ b/t/pod/selectheaders.pl
@@ -1,5 +1,6 @@
#!/usr/bin/perl -w
use strict;
+use warnings;
use Pod::Usage;
my $h2 = shift @ARGV || '.*';
diff --git a/t/pod/selectheaders.t b/t/pod/selectheaders.t
index ff138a3..0badc2f 100644
--- a/t/pod/selectheaders.t
+++ b/t/pod/selectheaders.t
@@ -1,5 +1,8 @@
use Test::More tests => 2;
+use strict;
+use warnings;
+
my $blib = $ENV{PERL_CORE} ? '-I../../lib' : '-Mblib';
my $pl = $0;
diff --git a/t/pod/selectsections.pl b/t/pod/selectsections.pl
index 0f1ad82..29c4d26 100644
--- a/t/pod/selectsections.pl
+++ b/t/pod/selectsections.pl
@@ -1,4 +1,7 @@
#!/usr/bin/env perl
+use strict;
+use warnings;
+
use Pod::Usage;
my @tests = (
diff --git a/t/pod/selectsections.t b/t/pod/selectsections.t
index d71c487..c6c1801 100644
--- a/t/pod/selectsections.t
+++ b/t/pod/selectsections.t
@@ -1,5 +1,8 @@
use Test::More tests => 2;
+use strict;
+use warnings;
+
my $blib = $ENV{PERL_CORE} ? '-I../../lib' : '-Mblib';
my $pl = $0;
--
2.24.3 (Apple Git-128)