diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2014-06-04 09:36:47 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-06-04 09:36:47 +0100 |
commit | d282356dcbd6d6033c3faa48338e09621a169a5d (patch) | |
tree | 8943c519ba8d96f6310b7f3ace82edf3dee71988 /t | |
parent | ffe94b38e1c9e3ec98aff466d9f8c03d9b4dbf04 (diff) | |
download | perl-libnet-d282356dcbd6d6033c3faa48338e09621a169a5d.tar.gz |
Use 5.008001, strict and warnings throughout
Diffstat (limited to 't')
-rw-r--r-- | t/config.t | 7 | ||||
-rw-r--r-- | t/datasend.t | 9 | ||||
-rw-r--r-- | t/external/pop3-ssl.t | 4 | ||||
-rw-r--r-- | t/external/smtp-ssl.t | 4 | ||||
-rw-r--r-- | t/ftp.t | 11 | ||||
-rw-r--r-- | t/hostname.t | 11 | ||||
-rw-r--r-- | t/libnet_t.pl | 4 | ||||
-rw-r--r-- | t/netrc.t | 9 | ||||
-rw-r--r-- | t/nntp.t | 13 | ||||
-rw-r--r-- | t/pop3_ipv6.t | 7 | ||||
-rw-r--r-- | t/pop3_ssl.t | 7 | ||||
-rw-r--r-- | t/require.t | 7 | ||||
-rw-r--r-- | t/smtp.t | 9 | ||||
-rw-r--r-- | t/smtp_ipv6.t | 7 | ||||
-rw-r--r-- | t/smtp_ssl.t | 7 | ||||
-rw-r--r-- | t/time.t | 7 |
16 files changed, 100 insertions, 23 deletions
@@ -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; @@ -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 { @@ -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"; @@ -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') { @@ -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 => .. @@ -1,4 +1,9 @@ -#!./perl -w +#!perl + +use 5.008001; + +use strict; +use warnings; BEGIN { if ($ENV{PERL_CORE}) { |