diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2006-05-18 23:50:51 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2006-05-18 23:50:51 +0000 |
commit | 30a1e583a8eba6a8430b7b3677331664508e6b0c (patch) | |
tree | 5a921e553703450a2f16e9e0baa736f09355b7d4 /t/op/write.t | |
parent | f2e0bb91ca7c0e6f975c2a54cb50ff00d953561c (diff) | |
download | perl-30a1e583a8eba6a8430b7b3677331664508e6b0c.tar.gz |
test some die codepaths in pp_enterwrite
p4raw-id: //depot/perl@28230
Diffstat (limited to 't/op/write.t')
-rwxr-xr-x | t/op/write.t | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/op/write.t b/t/op/write.t index 5ac4a251eb..25101d109d 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -58,7 +58,7 @@ for my $tref ( @NumTests ){ my $bas_tests = 20; # number of tests in section 3 -my $hmb_tests = 37; +my $hmb_tests = 39; printf "1..%d\n", $bas_tests + $num_tests + $hmb_tests; @@ -526,6 +526,22 @@ if ($^O eq 'VMS' || $^O eq 'MSWin32' || $^O eq 'dos' || $^O eq 'MacOS' || use strict; # Amazed that this hackery can be made strict ... +# DAPM. Exercise a couple of error codepaths + +{ + local $~ = ''; + eval { write }; + print "not " unless $@ and $@ =~ /Not a format reference/; + print "ok $test - Not a format reference\n"; + $test++; + + $~ = "NOSUCHFORMAT"; + eval { write }; + print "not " unless $@ and $@ =~ /Undefined format/; + print "ok $test - Undefined format\n"; + $test++; +} + # Just a complete test for format, including top-, left- and bottom marging # and format detection through glob entries |