From fda0c19015ffe803d5c2452f0c5ed23ce9cbbd5d Mon Sep 17 00:00:00 2001 From: "H.Merijn Brand" Date: Fri, 12 Nov 2010 14:55:00 +0100 Subject: Add a test to use duplicated frormat through glob --- t/op/write.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/t/op/write.t b/t/op/write.t index 8c2bc5416c..237c679c70 100644 --- a/t/op/write.t +++ b/t/op/write.t @@ -61,7 +61,7 @@ for my $tref ( @NumTests ){ my $bas_tests = 20; # number of tests in section 3 -my $bug_tests = 4 + 3 * 3 * 5 * 2 * 3 + 2 + 1 + 1; +my $bug_tests = 4 + 3 * 3 * 5 * 2 * 3 + 2 + 2 + 1; # number of tests in section 4 my $hmb_tests = 35; @@ -610,6 +610,16 @@ close STDOUT_DUP; *CmT = *{$::{Comment}}{FORMAT}; ok defined *{$::{CmT}}{FORMAT}, "glob assign"; +{ my $buf = ""; + open my $fh, ">", \$buf; + my $old_fh = select $fh; + local $~ = "CmT"; + write; + select $old_fh; + close $fh; + is $buf, "ok $test\n", "write to duplicated format"; +} + fresh_perl_like(<<'EOP', qr/^Format STDOUT redefined at/, {stderr => 1}, '#64562 - Segmentation fault with redefined formats and warnings'); #!./perl -- cgit v1.2.1