diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-06-18 20:18:02 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-06-18 20:18:02 +0000 |
commit | ee09ed4c5400432b740fa28e81457acfd0edfb65 (patch) | |
tree | b9cdeb7ce005bec16356aab14182ca2b1f8792bd | |
parent | f788fe6d36db92946e0ca25d9653b059d0ac6d35 (diff) | |
download | perl-ee09ed4c5400432b740fa28e81457acfd0edfb65.tar.gz |
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
-rwxr-xr-x | t/op/write.t | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/t/op/write.t b/t/op/write.t index 59fe268f59..3dd5023cbf 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: $!"; } |