summaryrefslogtreecommitdiff
path: root/lib/overload.t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-05-18 17:00:49 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-05-21 18:09:30 -0700
commit65f57195e2874c2856537d3f9d2b82ace1d47537 (patch)
treeec36b760ac1a7fc276ad43a809409fcf9996b46e /lib/overload.t
parent3aaeec97680c6839567bb4fb292d6aa1824c6031 (diff)
downloadperl-65f57195e2874c2856537d3f9d2b82ace1d47537.tar.gz
Make ‘no overload’ also warn about invalid args
Diffstat (limited to 'lib/overload.t')
-rw-r--r--lib/overload.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/overload.t b/lib/overload.t
index a622cf7fc3..390ffab9c2 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -48,7 +48,7 @@ package main;
$| = 1;
BEGIN { require './test.pl' }
-plan tests => 5050;
+plan tests => 5051;
use Scalar::Util qw(tainted);
@@ -962,11 +962,16 @@ unless ($aaa) {
my $a = "" ;
local $SIG{__WARN__} = sub {$a = $_[0]} ;
$x = eval ' use overload "~|_|~" => sub{} ' ;
+ eval ' no overload "~|_|~" ' ;
is($a, "");
use warnings 'overload' ;
$x = eval ' use overload "~|_|~" => sub{} ' ;
like($a, qr/^overload arg '~\|_\|~' is invalid at \(eval \d+\) line /,
'invalid arg warning');
+ undef $a;
+ eval ' no overload "~|_|~" ' ;
+ like($a, qr/^overload arg '~\|_\|~' is invalid at \(eval \d+\) line /,
+ 'invalid arg warning');
}
{