]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
update test suite for svg passthrough by img directive
authorJoey Hess <joeyh@joeyh.name>
Fri, 6 May 2016 00:44:11 +0000 (20:44 -0400)
committerSimon McVittie <smcv@debian.org>
Fri, 6 May 2016 05:58:56 +0000 (06:58 +0100)
Remove build dependency libmagickcore-6.q16-2-extra which was only there
for this test.

debian/control
t/img.t

index fb841bcb3d4c708a3f3edebe5c6a9a5e88636c8c..60d0e82dbc008bc60fdcef21510e8b8e18208bdf 100644 (file)
@@ -17,7 +17,7 @@ Build-Depends-Indep:
  libhtml-scrubber-perl,
  libhtml-template-perl,
  libimage-magick-perl | perlmagick,
- libmagickcore-6.q16-2-extra | libmagickcore-extra,
+ libmagickcore-extra,
  libnet-openid-consumer-perl,
  librpc-xml-perl,
  libtext-markdown-discount-perl,
diff --git a/t/img.t b/t/img.t
index ec23d621f341428843542fc7691396ead3cb8455..71b69914e14550c30f339e78cb45395726c5820d 100755 (executable)
--- a/t/img.t
+++ b/t/img.t
@@ -36,7 +36,6 @@ else {
 push @command, qw(--set usedirs=0 --plugin img t/tmp/in t/tmp/out --verbose);
 
 my $magick = new Image::Magick;
-my $SVGS_WORK = defined $magick->QueryFormat("svg");
 
 $magick->Read("t/img/twopages.pdf");
 my $PDFS_WORK = defined $magick->Get("width");
@@ -65,11 +64,6 @@ ok(! system("cp t/img/twopages.pdf t/tmp/in/really-pdf.jpg"));
 ok(! system("cp t/img/twopages.pdf t/tmp/in/really-pdf.png"));
 ok(! system("cp t/img/twopages.pdf t/tmp/in/really-pdf.svg"));
 
-my $maybe_svg_img = "";
-if ($SVGS_WORK) {
-       $maybe_svg_img = "[[!img bluesquare.svg size=10x]]";
-}
-
 my $maybe_pdf_img = "";
 if ($PDFS_WORK) {
        $maybe_pdf_img = <<EOF;
@@ -87,7 +81,9 @@ writefile("imgconversions.mdwn", "t/tmp/in", <<EOF
 [[!img hello:world.png size=x8]] expecting 8x8
 [[!img a:b:c.png size=x4]]
 [[!img a:b:c:d:e:f:g:h:i:j.png size=x6]]
-$maybe_svg_img
+[[!img bluesquare.svg size=42x]] expecting 42x
+[[!img bluesquare.svg size=x43]] expecting x43
+[[!img bluesquare.svg size=42x43]] expecting 42x43 because aspect rario not preserved
 $maybe_pdf_img
 
 # bad ideas
@@ -120,13 +116,9 @@ my $outhtml = readfile("$outpath.html");
 is(size("$outpath/10x-redsquare.png"), "10x10");
 ok(! -e "$outpath/30x-redsquare.png");
 ok($outhtml =~ /width="30" height="30".*expecting 30x30/);
-
-SKIP: {
-       skip "SVG support not installed (try libmagickcore-extra)", 1
-               unless $SVGS_WORK;
-       # if this fails, you need libmagickcore-6.q16-2-extra installed
-       is(size("$outpath/10x-bluesquare.png"), "10x10");
-}
+ok($outhtml =~ /width="42".*expecting 42x/);
+ok($outhtml =~ /height="43".*expecting x43/);
+ok($outhtml =~ /width="42" height="43".*expecting 42x43/);
 
 SKIP: {
        skip "PDF support not installed (try ghostscript)", 2