[ 22960]
When expecting an error, it's best to check the text you got, rather
than blindly assuming that it's correct.
p4raw-link: @22960 on //depot/perl:
ee09ed4c5400432b740fa28e81457acfd0edfb65
p4raw-id: //depot/maint-5.8/perl@22987
p4raw-integrated: from //depot/perl@22986 'merge in' t/op/write.t
(@22485..)
# 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";
}
.
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: $!";
}