From 30a1e583a8eba6a8430b7b3677331664508e6b0c Mon Sep 17 00:00:00 2001 From: Dave Mitchell Date: Thu, 18 May 2006 23:50:51 +0000 Subject: [PATCH] test some die codepaths in pp_enterwrite p4raw-id: //depot/perl@28230 --- t/op/write.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 -- 2.7.4