diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-01-16 16:39:17 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-01-16 16:39:17 +0000 |
commit | 0bd0581c0da439d1bc9686c40ce8eabbab0f37cd (patch) | |
tree | 44de1a96a4d02bb54aa1f82f82bddb6fba701ada /t | |
parent | a1b950687051c32e26de8681b0ed639ad32adfb4 (diff) | |
download | perl-0bd0581c0da439d1bc9686c40ce8eabbab0f37cd.tar.gz |
[perl #8698] format bug with undefined _TOP
name of format_TOP now derived from the name of the current
filehandle rather then the name of the format associetd with that
handle
p4raw-id: //depot/perl@22162
Diffstat (limited to 't')
-rwxr-xr-x | t/op/write.t | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/t/op/write.t b/t/op/write.t index 6e37cac538..9224d2f936 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -531,23 +531,27 @@ ok @<<<<< $test . -$= = 10; # [ID 20020227.005] format bug with undefined _TOP + +open STDOUT_DUP, ">&STDOUT"; +my $oldfh = select STDOUT_DUP; +$= = 10; { local $~ = "Comment"; write; $test++; print $- == 9 ? "ok $test # TODO\n" : "not ok $test # TODO \$- = $- instead of 9\n"; $test++; - print $^ ne "Comment_TOP" - ? "ok $test\n" : "not ok $test # TODO \$^ = $^ instead of 'STDOUT_TOP'\n"; + print $^ eq "STDOUT_DUP_TOP" + ? "ok $test\n" : "not ok $test\n# \$^ = $^ instead of 'STDOUT_DUP_TOP'\n"; $test++; - } +} +select $oldfh; - $^ = "STDOUT_TOP"; - $= = 7; # Page length - $- = 0; # Lines left +$^ = "STDOUT_TOP"; +$= = 7; # Page length +$- = 0; # Lines left my $ps = $^L; $^L = ""; # Catch the page separator my $tm = 1; # Top margin (empty lines before first output) my $bm = 2; # Bottom marging (empty lines between last text and footer) |