summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2002-09-19 15:34:01 -0700
committerhv <hv@crypt.org>2002-09-26 08:21:59 +0000
commitcb1ce60838923277ddef8cb8d26370507470dbd7 (patch)
tree925356630b65e9d9bbf88d95f6daa7813a129964 /t/comp
parent7bab3ede7bf671f54f0d8f3d55d015d9c9882812 (diff)
downloadperl-cb1ce60838923277ddef8cb8d26370507470dbd7.tar.gz
add TODO tests for slow our() declaration
Subject: Re: [perl #17376] Bug Report - our(%) Message-ID: <JNri9gzkgSBB092yn@efn.org> p4raw-id: //depot/perl@17921
Diffstat (limited to 't/comp')
-rw-r--r--t/comp/our.t49
1 files changed, 49 insertions, 0 deletions
diff --git a/t/comp/our.t b/t/comp/our.t
new file mode 100644
index 0000000000..c381c413ff
--- /dev/null
+++ b/t/comp/our.t
@@ -0,0 +1,49 @@
+#!./perl
+
+BEGIN {
+ chdir 't';
+ @INC = '../lib';
+ require './test.pl';
+}
+
+print "1..6\n";
+
+{
+ package TieAll;
+ # tie, track, and report what calls are made
+ my @calls;
+ sub AUTOLOAD {
+ for ($AUTOLOAD =~ /TieAll::(.*)/) {
+ if (/TIE/) { return bless {} }
+ elsif (/calls/) { return join ',', splice @calls }
+ else {
+ push @calls, $_;
+ # FETCHSIZE doesn't like undef
+ # if FIRSTKEY, see if NEXTKEY is also called
+ return 1 if /FETCHSIZE|FIRSTKEY/;
+ return;
+ }
+ }
+ }
+}
+
+tie $x, 'TieAll';
+tie @x, 'TieAll';
+tie %x, 'TieAll';
+
+{our $x;}
+is(TieAll->calls, '', 'our $x has no runtime effect');
+{our ($x);}
+is(TieAll->calls, '', 'our ($x) has no runtime effect');
+{our %x;}
+is(TieAll->calls, '', 'our %x has no runtime effect');
+
+{
+ local $TODO = 'perl #17376';
+ {our (%x);}
+ is(TieAll->calls, '', 'our (%x) has no runtime effect');
+ {our @x;}
+ is(TieAll->calls, '', 'our @x has no runtime effect');
+ {our (@x);}
+ is(TieAll->calls, '', 'our (@x) has no runtime effect');
+}