diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2002-09-19 15:34:01 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-09-26 08:21:59 +0000 |
commit | cb1ce60838923277ddef8cb8d26370507470dbd7 (patch) | |
tree | 925356630b65e9d9bbf88d95f6daa7813a129964 /t/comp | |
parent | 7bab3ede7bf671f54f0d8f3d55d015d9c9882812 (diff) | |
download | perl-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.t | 49 |
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'); +} |