summaryrefslogtreecommitdiffstats
path: root/tests/imgSVGnano.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/imgSVGnano.test')
-rw-r--r--tests/imgSVGnano.test34
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/imgSVGnano.test b/tests/imgSVGnano.test
index ff7046a..e2789c2 100644
--- a/tests/imgSVGnano.test
+++ b/tests/imgSVGnano.test
@@ -2,7 +2,7 @@
# and write SVG-format image files for photo widgets. The files is organized
# in the standard fashion for Tcl tests.
#
-# Copyright (c) 2018 Rene Zaumseil
+# Copyright © 2018 Rene Zaumseil
# All rights reserved.
package require tcltest 2.2
@@ -158,7 +158,7 @@ test imgSVGnano-3.7 {Option -scaletowidth} -body {
image width foo
} -cleanup {
rename foo ""
-} -result {20}
+} -result 20
test imgSVGnano-3.8 {Option -scaletoheight} -body {
image create photo foo -format "svg -scaletoheight 20"\
@@ -166,7 +166,7 @@ test imgSVGnano-3.8 {Option -scaletoheight} -body {
image height foo
} -cleanup {
rename foo ""
-} -result {20}
+} -result 20
test imgSVGnano-3.10 {change from -scaletoheight to -scale} -body {
set res {}
@@ -207,6 +207,34 @@ test imgSVGnano-4.2 {error on file not accessible on reread due to configure} -s
tcltest::removeFile tmpplus.svg
} -returnCodes error -match glob -result {couldn't open "*/tmpplus.svg": no such file or directory}
+# Special images
+test imgSVGnano-5.0 {image without any of "width", "height" and "viewbox"} -body {
+ image create photo foo -data\
+ {<?xml version="1.0"?><!DOCTYPE svg PUBLIC\
+ "-//W3C//DTD SVG 1.0//EN\"\
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\
+ <svg xmlns="http://www.w3.org/2000/svg">\
+ <g style="fill-opacity:0.7;">\
+ <circle cx="6.5cm" cy="2cm" r="100" style="fill:green;\
+ stroke:black; stroke-width:0.1cm" transform="translate(-70,150)"/>\
+ </g></svg>}
+} -cleanup {
+ rename foo ""
+} -result {foo}
+
+test imgSVGnano-5.1 {bug ea665e08f3 - too many values in parameters of the transform attribute} -body {
+ # shall not loop endlessly
+ image create photo foo -data\
+ {<?xml version="1.0"?><!DOCTYPE svg PUBLIC\
+ "-//W3C//DTD SVG 1.0//EN\"\
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">\
+ <svg xmlns="http://www.w3.org/2000/svg">\
+ <circle cx="6.5cm" cy="2cm" r="100" transform="skewX(1 1)"/>\
+ </g></svg>}
+} -cleanup {
+ rename foo ""
+} -result {foo}
+
};# end of namespace svgnano
namespace delete svgnano