]> 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 06:02:44 +0000 (07:02 +0100)
Remove build dependency libmagickcore-6.q16-2-extra which was only there
for this test.

debian/control
t/img.t

index 78bb683415cadee90b73c123786f8b3f6fc09bd6..68f543a2445437bb8aba8b465c6926303e84281d 100644 (file)
@@ -9,7 +9,7 @@ Build-Depends-Indep: dpkg-dev (>= 1.9.0), libxml-simple-perl,
   libhtml-parser-perl, liburi-perl (>= 1.36), perlmagick, po4a (>= 0.34),
   libfile-chdir-perl, libyaml-libyaml-perl, librpc-xml-perl,
   libcgi-pm-perl, libcgi-session-perl, ghostscript,
-  libmagickcore-6.q16-2-extra | libmagickcore-extra,
+  libmagickcore-extra,
   libcgi-formbuilder-perl
 Maintainer: Simon McVittie <smcv@debian.org>
 Uploaders: Josh Triplett <josh@freedesktop.org>
diff --git a/t/img.t b/t/img.t
index 5d0e0f09cdbc127eb264f99e0aae7645d1a92a09..401858a13bd1c04a579d750d1ab79109b7b9bece 100755 (executable)
--- a/t/img.t
+++ b/t/img.t
@@ -35,7 +35,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");
@@ -64,11 +63,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;
@@ -86,7 +80,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
@@ -119,13 +115,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