test we don't use vars and that we have use 5.006.
authorTony Cook <tony@develop-help.com>
Sun, 14 Jun 2020 03:12:43 +0000 (13:12 +1000)
committerTony Cook <tony@develop-help.com>
Sun, 14 Jun 2020 03:12:43 +0000 (13:12 +1000)
t/950-kwalitee/080-nousevars.t [new file with mode: 0644]

diff --git a/t/950-kwalitee/080-nousevars.t b/t/950-kwalitee/080-nousevars.t
new file mode 100644 (file)
index 0000000..c1fa27a
--- /dev/null
@@ -0,0 +1,17 @@
+#!perl -w
+use strict;
+use ExtUtils::Manifest qw(maniread);
+use Test::More;
+
+my $manifest = maniread();
+my @pm = sort grep /\.pm$/ && !m(Devel/CheckLib.pm$), keys %$manifest;
+
+for my $file (@pm) {
+  open my $pm, "<", $file
+    or die "Cannot open $file; $!";
+  my $lines = join "", <$pm>;
+  ok($lines =~ /^ *our \$VERSION/m, "$file: has a \$VERSION");
+  ok($lines =~ /^use 5\.006;$/m, "$file: has use 5.006");
+  ok($lines !~ /use vars/, "$file: hasn't any use vars");
+}
+done_testing();