develooper Front page | perl.perl5.porters | Postings from May 2003

Re: [perl #22372] [PATCH] sv_chop() broken

From:
Enache Adrian
Date:
May 31, 2003 04:16
Subject:
Re: [perl #22372] [PATCH] sv_chop() broken
Message ID:
20030531111811.GA1240@ratsnest.hole
On Sat, May 31, 2003 at 11:10:56AM +0200, Rafael Garcia-Suarez wrote:
> Enache Adrian wrote:
> > +{
> > +    my $el;
> > +    format STDOUT =
> > +ok ^<<<<<<<<<<<<<<~~ # sv_chop() naze
> > +$el
> > +.
> > +    my %hash = (12 => 3);
> > +    for $el (keys %hash) {
> > +	write;
> > +    }
> > +}
> This outputs nothing for me.

That's curious, because blead ~ 19600 just worked.
Changing 'my $el' to 'our $el' makes it work again (blead@19641).

> Moreover you apparenly forgot to update the skip count a few lines
> below :

Oops.
Modified patch for t/op/write.t below.

--- /arc/bleadperl/t/op/write.t	2002-04-29 00:31:14.000000000 +0300
+++ ./t/op/write.t	2003-05-31 14:10:11.000000000 +0300
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..47\n";
+print "1..48\n";
 
 my $CAT = ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') ? 'type'
 	: ($^O eq 'MacOS') ? 'catenate'
@@ -271,17 +271,29 @@ if (`$CAT Op_write.tmp` eq $right)
 else
     { print "not ok 11\n"; }
 
-# 12..47: scary format testing from Merijn H. Brand
+{
+    our $el;
+    format STDOUT =
+ok ^<<<<<<<<<<<<<<~~ # sv_chop() naze
+$el
+.
+    my %hash = (12 => 3);
+    for $el (keys %hash) {
+	write;
+    }
+}
+
+# 13..48: scary format testing from Merijn H. Brand
 
 if ($^O eq 'VMS' || $^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'MacOS' ||
     ($^O eq 'os2' and not eval '$OS2::can_fork')) {
-  foreach (12..47) { print "ok $_ # skipped: '|-' and '-|' not supported\n"; }
+  foreach (13..48) { print "ok $_ # skipped: '|-' and '-|' not supported\n"; }
   exit(0);
 }
 
 use strict;	# Amazed that this hackery can be made strict ...
 
-my $test = 12;
+my $test = 13;
 
 # Just a complete test for format, including top-, left- and bottom marging
 # and format detection through glob entries



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