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;
# 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: $!";
}
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
}
}
close FROM_CHILD;
- print + (@data?"not ":""), "ok ", $test++, " - too litle output\n";
+ print + (@data?"not ":""), "ok ", $test++, " - too little output\n";
exit;
}