summaryrefslogtreecommitdiff
path: root/lib/overload.t
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2013-03-25 01:22:35 -0300
committerKarl Williamson <public@khwilliamson.com>2013-03-26 21:06:52 -0600
commit0f539b13d39feb3bad9b2c86a57dea5035124802 (patch)
treea6481e6c7d13e8681c8bb93e4d8a9ebe563f5598 /lib/overload.t
parent629deb5825bff527bfd3021146f63d64c72b50ce (diff)
downloadperl-0f539b13d39feb3bad9b2c86a57dea5035124802.tar.gz
Make smartmatch, given & when experimental
Diffstat (limited to 'lib/overload.t')
-rw-r--r--lib/overload.t6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/overload.t b/lib/overload.t
index a90005db4d..74adae340e 100644
--- a/lib/overload.t
+++ b/lib/overload.t
@@ -1873,6 +1873,7 @@ foreach my $op (qw(<=> == != < <= > >=)) {
for my $sub (keys %subs) {
+ no warnings 'experimental::smartmatch';
my $term = $subs{$sub};
my $t = sprintf $term, '$_[0][0]';
my $e ="sub { \$funcs .= '($sub)'; my \$r; if (\$use_int) {"
@@ -1914,6 +1915,7 @@ foreach my $op (qw(<=> == != < <= > >=)) {
? "-\$_[0][0]"
: "$_[3](\$_[0][0])";
my $r;
+ no warnings 'experimental::smartmatch';
if ($use_int) {
use integer; $r = eval $e;
}
@@ -1960,7 +1962,7 @@ foreach my $op (qw(<=> == != < <= > >=)) {
$use_int = ($int ne '');
my $plain = $tainted_val;
my $plain_term = $int . sprintf $sub_term, '$plain';
- my $exp = eval $plain_term;
+ my $exp = do {no warnings 'experimental::smartmatch'; eval $plain_term };
diag("eval of plain_term <$plain_term> gave <$@>") if $@;
is(tainted($exp), $exp_taint,
"<$plain_term> taint of expected return");
@@ -1988,7 +1990,7 @@ foreach my $op (qw(<=> == != < <= > >=)) {
my $res_term = $int . sprintf $sub_term, $var;
my $desc = "<$res_term> $ov_pkg" ;
- my $res = eval $res_term;
+ my $res = do { no warnings 'experimental::smartmatch'; eval $res_term };
diag("eval of res_term $desc gave <$@>") if $@;
# uniquely, the inc/dec ops return the original
# ref rather than a copy, so stringify it to