From: Nicholas Clark Date: Fri, 18 Jun 2004 20:18:02 +0000 (+0000) Subject: When expecting an error, it's best to check the text you got, rather X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ee09ed4c5400432b740fa28e81457acfd0edfb65;p=p5sagit%2Fp5-mst-13.2.git When expecting an error, it's best to check the text you got, rather than blindly assuming that it's correct. p4raw-id: //depot/perl@22960 --- diff --git a/t/op/write.t b/t/op/write.t index 59fe268..3dd5023 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -365,7 +365,8 @@ $v # must fail since we have a trailing ; in the eval'ed string (WL) my @v = ('k'); eval "format OUT14 = \n@\n\@v"; - print $@ ? "ok 14\n" : "not ok 14\n"; + print +($@ && $@ =~ /Format not terminated/) + ? "ok 14\n" : "not ok 14 $@\n"; } @@ -431,7 +432,8 @@ EOD . open(OUT18, '>Op_write.tmp') || die "Can't create Op_write.tmp"; eval { write(OUT18); }; - print $@ ? "ok 18\n" : "not ok 18\n"; + print +($@ && $@ =~ /Repeated format line will never terminate/) + ? "ok 18\n" : "not ok 18: $@\n"; close OUT18 or die "Could not close: $!"; }