diff options
-rw-r--r-- | lib/Net/t/netrc.t | 6 | ||||
-rwxr-xr-x | t/op/stat.t | 4 | ||||
-rwxr-xr-x | t/op/taint.t | 2 | ||||
-rwxr-xr-x | t/op/ver.t | 2 | ||||
-rw-r--r-- | t/test.pl | 1 |
5 files changed, 9 insertions, 6 deletions
diff --git a/lib/Net/t/netrc.t b/lib/Net/t/netrc.t index 885b515452..464794b956 100644 --- a/lib/Net/t/netrc.t +++ b/lib/Net/t/netrc.t @@ -58,7 +58,8 @@ SKIP: { $stat[2] = 077; ok( !defined(Net::Netrc::_readrc()), '_readrc() should not read world-writable file' ); - ok( $warn =~ /^Bad permissions:/, '... and should warn about it' ); + ok( scalar( $warn =~ /^Bad permissions:/ ), + '... and should warn about it' ); # the owner field should still not match $stat[2] = 0; @@ -66,7 +67,8 @@ SKIP: { if ($<) { ok( !defined(Net::Netrc::_readrc()), '_readrc() should not read file owned by someone else' ); - ok( $warn =~ /^Not owner:/, '... and should warn about it' ); + ok( scalar( $warn =~ /^Not owner:/ ), + '... and should warn about it' ); } else { ok(1, "Skip - testing as root") for 1..2; } diff --git a/t/op/stat.t b/t/op/stat.t index ad87c25b0b..6bb331592d 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -336,14 +336,14 @@ SKIP: { ok(! -B FOO, ' !-B'); $_ = <FOO>; - ok(/perl/, 'after readline'); + like($_, qr/perl/, 'after readline'); ok(-T FOO, ' still -T'); ok(! -B FOO, ' still -B'); close(FOO); open(FOO,'op/stat.t'); $_ = <FOO>; - ok(/perl/, 'reopened and after readline'); + like($_, qr/perl/, 'reopened and after readline'); ok(-T FOO, ' still -T'); ok(! -B FOO, ' still !-B'); diff --git a/t/op/taint.t b/t/op/taint.t index 7c83019e7c..63fc32e8a4 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -16,7 +16,7 @@ use strict; use Config; my $test = 177; -sub ok { +sub ok ($;$) { my($ok, $name) = @_; # You have to do it this way or VMS will get confused. diff --git a/t/op/ver.t b/t/op/ver.t index a7e57a63ce..1dc28d2d35 100755 --- a/t/op/ver.t +++ b/t/op/ver.t @@ -191,7 +191,7 @@ SKIP: { my $ip = v2004.148.0.1; my $host; eval { $host = gethostbyaddr($ip,Socket::AF_INET) }; - ok($@ =~ /Wide character/,"Non-bytes leak to gethostbyaddr"); + like($@, qr/Wide character/, "Non-bytes leak to gethostbyaddr"); } # Chapter 28, pp671 @@ -77,6 +77,7 @@ sub _where { return "at $caller[1] line $caller[2]"; } +# DON'T use this for matches. Use like() instead. sub ok { my ($pass, $name, @mess) = @_; _ok($pass, _where(), $name, @mess); |