about summary refs log tree commit
path: root/t
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2014-06-04 09:36:47 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2014-06-04 09:36:47 +0100
commitd282356dcbd6d6033c3faa48338e09621a169a5d (patch)
tree8943c519ba8d96f6310b7f3ace82edf3dee71988 /t
parentffe94b38e1c9e3ec98aff466d9f8c03d9b4dbf04 (diff)
downloadperl-libnet-d282356dcbd6d6033c3faa48338e09621a169a5d.tar.gz
Use 5.008001, strict and warnings throughout
Diffstat (limited to 't')
-rw-r--r--t/config.t7
-rw-r--r--t/datasend.t9
-rw-r--r--t/external/pop3-ssl.t4
-rw-r--r--t/external/smtp-ssl.t4
-rw-r--r--t/ftp.t11
-rw-r--r--t/hostname.t11
-rw-r--r--t/libnet_t.pl4
-rw-r--r--t/netrc.t9
-rw-r--r--t/nntp.t13
-rw-r--r--t/pop3_ipv6.t7
-rw-r--r--t/pop3_ssl.t7
-rw-r--r--t/require.t7
-rw-r--r--t/smtp.t9
-rw-r--r--t/smtp_ipv6.t7
-rw-r--r--t/smtp_ssl.t7
-rw-r--r--t/time.t7
16 files changed, 100 insertions, 23 deletions
diff --git a/t/config.t b/t/config.t
index 3a34251..be508e3 100644
--- a/t/config.t
+++ b/t/config.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     if ($ENV{PERL_CORE}) {
diff --git a/t/datasend.t b/t/datasend.t
index f642340..1c4a0c7 100644
--- a/t/datasend.t
+++ b/t/datasend.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     if ($ENV{PERL_CORE}) {
@@ -18,7 +23,7 @@ BEGIN {
 
   use IO::File;
   use Net::Cmd;
-  @ISA = qw(Net::Cmd IO::File);
+  our @ISA = qw(Net::Cmd IO::File);
 
   sub timeout { 0 }
 
diff --git a/t/external/pop3-ssl.t b/t/external/pop3-ssl.t
index 6eec93c..554a8db 100644
--- a/t/external/pop3-ssl.t
+++ b/t/external/pop3-ssl.t
@@ -1,6 +1,10 @@
+#!perl
+
+use 5.008001;
 
 use strict;
 use warnings;
+
 use Net::POP3;
 use Test::More;
 
diff --git a/t/external/smtp-ssl.t b/t/external/smtp-ssl.t
index 1802976..ccacbae 100644
--- a/t/external/smtp-ssl.t
+++ b/t/external/smtp-ssl.t
@@ -1,6 +1,10 @@
+#!perl
+
+use 5.008001;
 
 use strict;
 use warnings;
+
 use Net::SMTP;
 use Test::More;
 
diff --git a/t/ftp.t b/t/ftp.t
index 0c1b0e3..7ee4623 100644
--- a/t/ftp.t
+++ b/t/ftp.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     unless (-d 'blib') {
@@ -29,7 +34,7 @@ unless($NetConfig{test_hosts}) {
 my $t = 1;
 print "1..7\n";
 
-$ftp = Net::FTP->new($NetConfig{ftp_testhost})
+my $ftp = Net::FTP->new($NetConfig{ftp_testhost})
         or (print("not ok 1\n"), exit);
 
 printf "ok %d\n",$t++;
@@ -49,12 +54,14 @@ $ftp->cwd('/pub') or do {
   print "not ";
 };
 
+my $data;
 if ($data = $ftp->stor('libnet.tst')) {
   my $text = "abc\ndef\nqwe\n";
   printf "ok %d\n",$t++;
   $data->write($text,length $text);
   $data->close;
   $data = $ftp->retr('libnet.tst');
+  my $buf;
   $data->read($buf,length $text);
   $data->close;
   print "not " unless $text eq $buf;
diff --git a/t/hostname.t b/t/hostname.t
index f486bb4..e831b2d 100644
--- a/t/hostname.t
+++ b/t/hostname.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     unless (-d 'blib') {
@@ -23,7 +28,7 @@ unless($NetConfig{test_hosts}) {
 
 print "1..5\n";
 
-$domain = domainname();
+my $domain = domainname();
 
 if(defined $domain && $domain ne "") {
  print "ok 1 - defined, non-empty domainname\n";
@@ -52,7 +57,7 @@ my @dummy = grep { defined hostname() and hostname() eq $_ } @domain;
   : print "not ok 3\n";
 
 my $name = hostname();
-my $domain = hostdomain();
+$domain = hostdomain();
 if(defined $domain && defined $name && $name ne "" && $domain ne "") {
     hostfqdn() eq $name . "." . $domain ? print "ok 4\n" : print "not ok 4\n";
     domainname() eq $name . "." . $domain ? print "ok 5\n" : print "not ok 5\n";} else {
diff --git a/t/libnet_t.pl b/t/libnet_t.pl
index 9337dd1..cc512ca 100644
--- a/t/libnet_t.pl
+++ b/t/libnet_t.pl
@@ -1,3 +1,7 @@
+use 5.008001;
+
+use strict;
+use warnings;
 
 my $number = 0;
 sub ok {
diff --git a/t/netrc.t b/t/netrc.t
index bb97244..d06cf90 100644
--- a/t/netrc.t
+++ b/t/netrc.t
@@ -1,4 +1,9 @@
-#!./perl
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     if ($ENV{PERL_CORE}) {
@@ -13,8 +18,6 @@ BEGIN {
     }
 }
 
-use strict;
-
 use Cwd;
 print "1..20\n";
 
diff --git a/t/nntp.t b/t/nntp.t
index 643cfc8..a084045 100644
--- a/t/nntp.t
+++ b/t/nntp.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     unless (-d 'blib') {
@@ -26,13 +31,13 @@ print "1..4\n";
 
 my $i = 1;
 
-$nntp = Net::NNTP->new(Debug => 0)
+my $nntp = Net::NNTP->new(Debug => 0)
         or (print("not ok 1\n"), exit);
 
 print "ok 1\n";
 
-my $grp;
-foreach $grp (qw(test alt.test control news.announce.newusers)) {
+my @grp;
+foreach my $grp (qw(test alt.test control news.announce.newusers)) {
     @grp = $nntp->group($grp);
     last if @grp;
 }
diff --git a/t/pop3_ipv6.t b/t/pop3_ipv6.t
index 2f073ab..9b3c8cb 100644
--- a/t/pop3_ipv6.t
+++ b/t/pop3_ipv6.t
@@ -1,8 +1,13 @@
+#!perl
+
+use 5.008001;
+
 use strict;
 use warnings;
-use Test::More;
+
 use File::Temp 'tempfile';
 use Net::POP3;
+use Test::More;
 
 my $debug = 0; # Net::POP3->new( Debug => .. )
 
diff --git a/t/pop3_ssl.t b/t/pop3_ssl.t
index 08ef266..3ba74af 100644
--- a/t/pop3_ssl.t
+++ b/t/pop3_ssl.t
@@ -1,8 +1,13 @@
+#!perl
+
+use 5.008001;
+
 use strict;
 use warnings;
-use Test::More;
+
 use File::Temp 'tempfile';
 use Net::POP3;
+use Test::More;
 
 my $debug = 0; # Net::POP3 Debug => ..
 
diff --git a/t/require.t b/t/require.t
index 973ed41..d7f839d 100644
--- a/t/require.t
+++ b/t/require.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     unless (-d 'blib') {
diff --git a/t/smtp.t b/t/smtp.t
index 6daef31..5bd1966 100644
--- a/t/smtp.t
+++ b/t/smtp.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     unless (-d 'blib') {
@@ -25,7 +30,7 @@ print "1..3\n";
 
 my $i = 1;
 
-$smtp = Net::SMTP->new(Debug => 0)
+my $smtp = Net::SMTP->new(Debug => 0)
         or (print("not ok 1\n"), exit);
 
 print "ok 1\n";
diff --git a/t/smtp_ipv6.t b/t/smtp_ipv6.t
index 6a01520..6e4a990 100644
--- a/t/smtp_ipv6.t
+++ b/t/smtp_ipv6.t
@@ -1,8 +1,13 @@
+#!perl
+
+use 5.008001;
+
 use strict;
 use warnings;
-use Test::More;
+
 use File::Temp 'tempfile';
 use Net::SMTP;
+use Test::More;
 
 my $debug = 0; # Net::SMTP->new( Debug => .. )
 
diff --git a/t/smtp_ssl.t b/t/smtp_ssl.t
index e7391f3..b7a533f 100644
--- a/t/smtp_ssl.t
+++ b/t/smtp_ssl.t
@@ -1,8 +1,13 @@
+#!perl
+
+use 5.008001;
+
 use strict;
 use warnings;
-use Test::More;
+
 use File::Temp 'tempfile';
 use Net::SMTP;
+use Test::More;
 
 my $debug = 0; # Net::SMTP Debug => ..
 
diff --git a/t/time.t b/t/time.t
index 224b640..07712fb 100644
--- a/t/time.t
+++ b/t/time.t
@@ -1,4 +1,9 @@
-#!./perl -w
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
 
 BEGIN {
     if ($ENV{PERL_CORE}) {