make img unittest easier to debug

master
chrysn 2014-07-15 14:03:00 +02:00
parent fa2a4d0db4
commit a0a26d24f9
1 changed files with 12 additions and 9 deletions

View File

@ -43,7 +43,8 @@ ok(! system($command));
sub size($) { sub size($) {
my $filename = shift; my $filename = shift;
my $im = Image::Magick->new(); my $im = Image::Magick->new();
$im->Read($filename); my $r = $im->Read($filename);
return "no image" if $r;
my $w = $im->Get("width"); my $w = $im->Get("width");
my $h = $im->Get("height"); my $h = $im->Get("height");
return "${w}x${h}"; return "${w}x${h}";
@ -58,6 +59,7 @@ is(size("$outpath/16x-p1-twopages.png"), "16x2");
# now let's remove them again # now let's remove them again
if (1) { # for easier testing
writefile("imgconversions.mdwn", "t/tmp/in", "nothing to see here"); writefile("imgconversions.mdwn", "t/tmp/in", "nothing to see here");
ok(! system("$command --refresh")); ok(! system("$command --refresh"));
@ -69,6 +71,7 @@ ok(! -e "$outpath/10x-p1-simple-pdf.png");
# cleanup # cleanup
ok(! system("rm -rf t/tmp")); ok(! system("rm -rf t/tmp"));
}
done_testing; done_testing;
1; 1;