From dcac8e93ece7ecb44db05966281d2d0a12cb50a2 Mon Sep 17 00:00:00 2001 From: Paul Cochrane Date: Thu, 10 Aug 2017 15:13:38 +0200 Subject: [PATCH] Add strict and warnings pragmas to test scripts --- test/api.t | 3 +++ test/export-api.t | 3 +++ test/flatten.t | 3 +++ test/function-rule.t | 3 +++ test/grammar-api.t | 3 +++ test/parse.t | 5 ++++- test/repeat.t | 3 +++ test/safe.t | 3 +++ test/sample.t | 3 +++ 9 files changed, 28 insertions(+), 1 deletion(-) diff --git a/test/api.t b/test/api.t index 3b8124e..1944629 100644 --- a/test/api.t +++ b/test/api.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More; use Pegex::Parser; diff --git a/test/export-api.t b/test/export-api.t index 4178113..6237f31 100644 --- a/test/export-api.t +++ b/test/export-api.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + # BEGIN { $Pegex::Parser::Debug = 1 } use Test::More tests => 8; diff --git a/test/flatten.t b/test/flatten.t index b585d6a..665721c 100644 --- a/test/flatten.t +++ b/test/flatten.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More tests => 1; use Pegex; diff --git a/test/function-rule.t b/test/function-rule.t index ba91d88..16ec494 100644 --- a/test/function-rule.t +++ b/test/function-rule.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More; use Pegex::Parser; diff --git a/test/grammar-api.t b/test/grammar-api.t index 367529c..ec4f3ed 100644 --- a/test/grammar-api.t +++ b/test/grammar-api.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More tests => 1; package MyGrammar1; diff --git a/test/parse.t b/test/parse.t index 55b45ae..b7535ff 100644 --- a/test/parse.t +++ b/test/parse.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + # $Pegex::Parser::Debug = 1; my $t; use lib ($t = -e 't' ? 't' : 'test'); @@ -6,7 +9,7 @@ use Test::More tests => 1; use Pegex; use Pegex::Input; -$grammar_file = "$t/mice.pgx"; +my $grammar_file = "$t/mice.pgx"; eval { pegex( Pegex::Input->new(file => $grammar_file) )->parse("3 blind mice\n") }; $@ ? fail $@ diff --git a/test/repeat.t b/test/repeat.t index bc078b8..ac5080c 100644 --- a/test/repeat.t +++ b/test/repeat.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More; use Pegex; diff --git a/test/safe.t b/test/safe.t index 22555ad..1bf3b41 100644 --- a/test/safe.t +++ b/test/safe.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More; # 2015-02-03 Safe.pm fails to load on Travis + 5.14 diff --git a/test/sample.t b/test/sample.t index e6c34b5..e400002 100644 --- a/test/sample.t +++ b/test/sample.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More; eval "use YAML::XS; 1" or