summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-01-17 13:29:56 +0100
committerNicholas Clark <nick@ccl4.org>2012-01-17 13:29:56 +0100
commit33f89799d9328f3d175aa913900d16794119e284 (patch)
treef0d8ebd235826e0778327aa9e1d51b50c3eea8d9 /t
parentef8156f500dbf5c96a21512c58184fbca79bcfb7 (diff)
downloadperl-33f89799d9328f3d175aa913900d16794119e284.tar.gz
Avoid 'defined(@array) is deprecated' warnings in tests.
Commit 604a99bd464c92d7 enabled the warning for package arrays, but failed to lexically disable the warning for the various tests for the construction. Even though the construction is deprecated, we'd still like to know if the behaviour changes, in case it wasn't intentional.
Diffstat (limited to 't')
-rw-r--r--t/op/gv.t5
-rw-r--r--t/op/method.t3
-rw-r--r--t/op/undef.t12
-rw-r--r--t/uni/gv.t5
4 files changed, 20 insertions, 5 deletions
diff --git a/t/op/gv.t b/t/op/gv.t
index 798cc731e3..e2eae33099 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -192,7 +192,10 @@ is (*{*x{GLOB}}, "*main::STDOUT");
my $a = "SYM000";
ok(!defined *{$a});
- ok(!defined @{$a});
+ {
+ no warnings 'deprecated';
+ ok(!defined @{$a});
+ }
ok(!defined *{$a});
{
diff --git a/t/op/method.t b/t/op/method.t
index f84f6e2aeb..7867095c85 100644
--- a/t/op/method.t
+++ b/t/op/method.t
@@ -172,7 +172,10 @@ is(A->eee(), "new B: In A::eee, 4"); # Which sticks
{
no strict 'refs';
+ no warnings 'deprecated';
# this test added due to bug discovery (in 5.004_04, fb73857aa0bfa8ed)
+ # Possibly kill this test now that defined @::array is finally properly
+ # deprecated?
is(defined(@{"unknown_package::ISA"}) ? "defined" : "undefined", "undefined");
}
diff --git a/t/op/undef.t b/t/op/undef.t
index ec8d832515..eafa6dbe60 100644
--- a/t/op/undef.t
+++ b/t/op/undef.t
@@ -44,14 +44,17 @@ ok !defined($ary{'bar'});
undef $ary{'foo'};
ok !defined($ary{'foo'});
-ok defined(@ary);
{
no warnings 'deprecated';
+ ok defined(@ary);
ok defined(%ary);
}
ok %ary;
undef @ary;
-ok !defined(@ary);
+{
+ no warnings 'deprecated';
+ ok !defined(@ary);
+}
undef %ary;
{
no warnings 'deprecated';
@@ -59,7 +62,10 @@ undef %ary;
}
ok !%ary;
@ary = (1);
-ok defined @ary;
+{
+ no warnings 'deprecated';
+ ok defined @ary;
+}
%ary = (1,1);
{
no warnings 'deprecated';
diff --git a/t/uni/gv.t b/t/uni/gv.t
index bd1fee14d6..f128ec585b 100644
--- a/t/uni/gv.t
+++ b/t/uni/gv.t
@@ -194,7 +194,10 @@ is (*{*Ẋ{GLOB}}, "*main::STDOUT");
my $a = "Sʎm000";
ok(!defined *{$a});
- ok(!defined @{$a});
+ {
+ no warnings 'deprecated';
+ ok(!defined @{$a});
+ }
ok(!defined *{$a});
{