aboutsummaryrefslogtreecommitdiff
path: root/perl/t/object
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2014-07-11 22:36:11 -0700
committerRuss Allbery <rra@stanford.edu>2014-07-11 22:39:23 -0700
commit1329e6db944a6fce5578b249de08a8250a920877 (patch)
tree2dd24e191af3767a93a21db9cd6b183164dbe491 /perl/t/object
parentbf513da9cc1bc6f125aded53685cf71083c5ae56 (diff)
Test for Perl strict and minimum version
Fix strictness issues across the whole code base, and ensure that all Perl scripts enable warnings. (Hopefully enabling warnings won't cause problems for the server.) Change-Id: I4dee49f7a6bcbeeee21d74bf61a1fd26514f832c Reviewed-on: https://gerrit.stanford.edu/1532 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/t/object')
-rwxr-xr-xperl/t/object/base.t5
-rwxr-xr-xperl/t/object/file.t7
-rwxr-xr-xperl/t/object/keytab.t11
3 files changed, 16 insertions, 7 deletions
diff --git a/perl/t/object/base.t b/perl/t/object/base.t
index 0432a23..11f18b7 100755
--- a/perl/t/object/base.t
+++ b/perl/t/object/base.t
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# Tests for the basic object implementation.
#
@@ -8,6 +8,9 @@
#
# See LICENSE for licensing terms.
+use strict;
+use warnings;
+
use POSIX qw(strftime);
use Test::More tests => 137;
diff --git a/perl/t/object/file.t b/perl/t/object/file.t
index 0aecd9d..201f46d 100755
--- a/perl/t/object/file.t
+++ b/perl/t/object/file.t
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# Tests for the file object implementation.
#
@@ -8,6 +8,9 @@
#
# See LICENSE for licensing terms.
+use strict;
+use warnings;
+
use POSIX qw(strftime);
use Test::More tests => 56;
@@ -39,7 +42,7 @@ my $history = '';
my $date = strftime ('%Y-%m-%d %H:%M:%S', localtime $trace[2]);
# Test error handling in the absence of configuration.
-$object = eval {
+my $object = eval {
Wallet::Object::File->create ('file', 'test', $schema, @trace)
};
ok (defined ($object), 'Creating a basic file object succeeds');
diff --git a/perl/t/object/keytab.t b/perl/t/object/keytab.t
index 127762a..0f4a8b8 100755
--- a/perl/t/object/keytab.t
+++ b/perl/t/object/keytab.t
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# Tests for the keytab object implementation.
#
@@ -8,6 +8,9 @@
#
# See LICENSE for licensing terms.
+use strict;
+use warnings;
+
use POSIX qw(strftime);
use Test::More tests => 141;
@@ -117,7 +120,7 @@ sub enctypes {
next unless /^ *\d+ /;
my ($string) = /\((.*)\)\s*$/;
next unless $string;
- $enctype = $enctype{lc $string} || 'UNKNOWN';
+ my $enctype = $enctype{lc $string} || 'UNKNOWN';
push (@enctypes, $enctype);
}
close KLIST;
@@ -174,7 +177,7 @@ SKIP: {
# Test that object creation without KEYTAB_TMP fails.
undef $Wallet::Config::KEYTAB_TMP;
- $object = eval {
+ my $object = eval {
Wallet::Object::Keytab->create ('keytab', 'wallet/one', $schema,
@trace)
};
@@ -634,7 +637,7 @@ EOO
is ("@values", "@enctypes", ' and we get back the right enctype list');
my $eshow = join ("\n" . (' ' x 17), @enctypes);
$eshow =~ s/\s+\z/\n/;
- $expected = <<"EOO";
+ my $expected = <<"EOO";
Type: keytab
Name: wallet/one
Enctypes: $eshow