From: Dave Mitchell Date: Thu, 18 May 2006 23:50:51 +0000 (+0000) Subject: test some die codepaths in pp_enterwrite X-Git-Tag: accepted/trunk/20130322.191538~17619 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30a1e583a8eba6a8430b7b3677331664508e6b0c;p=platform%2Fupstream%2Fperl.git test some die codepaths in pp_enterwrite p4raw-id: //depot/perl@28230 --- diff --git a/t/op/write.t b/t/op/write.t index 5ac4a25..25101d1 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