develooper Front page | perl.perl5.porters | Postings from March 2006

PATCH t/op/tie.t

Thread Next
From:
Robin Barker
Date:
March 30, 2006 04:08
Subject:
PATCH t/op/tie.t
Message ID:
533D273D4014D411AB1D00062938C4D90849C9CA@hotel.npl.ad.local
I found a bug, when using the Readonly module, that turned out to be a bug in perl 5.8

% perl5.8.8 -lwe 'sub TIESCALAR { my $foo = $_[1]; bless \$foo, $_[0] } \
sub FETCH { ${$_[0]} } tie my $x, "main", 2; tie my $y, "main", 8; print $x | $y'
:

% perl5.9.4 -lwe 'sub TIESCALAR { my $foo = $_[1]; bless \$foo, $_[0] } \
sub FETCH { ${$_[0]} } tie my $x, "main", 2; tie my $y, "main", 8; print $x | $y'
10

The patch below adds a further test to t/op/tie.t to ensure my bug does not reappear.

I think this test and the patch that allows it to pass should be included in 5.8.9.
I think this was fixed by patch 26192 (which added the last test to t/op/tie.t).

Robin
--- ../perl-current/t/op/tie.t  Tue Nov 22 16:24:52 2005
+++ ./t/op/tie.t        Thu Mar 30 09:59:50 2006
@@ -585,3 +585,11 @@
 print $h.$h;
 EXPECT
 01
+########
+sub TIESCALAR { my $foo = $_[1]; bless \$foo, $_[0] }
+sub FETCH { ${$_[0]} }
+tie my $x, "main", 2;
+tie my $y, "main", 8;
+print $x | $y;
+EXPECT
+10

-------------------------------------------------------------------
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Serco House, 16 Bartley Wood Business Park,
                   Hook, Hampshire, United Kingdom  RG27 9UY
-------------------------------------------------------------------

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About