Some transform test files in need of corresponding test code.
|
|
@ -1222,6 +1222,7 @@ class RemoveDefsWithWhitespace(unittest.TestCase):
|
||||||
# TODO: write a test for --disable-embed-rasters
|
# TODO: write a test for --disable-embed-rasters
|
||||||
# TODO: write tests for --keep-editor-data
|
# TODO: write tests for --keep-editor-data
|
||||||
# TODO: write tests for scouring transformations
|
# TODO: write tests for scouring transformations
|
||||||
|
# progress: the unittests/transform-* files list expected before/after behaviour
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
testcss = __import__('testcss')
|
testcss = __import__('testcss')
|
||||||
|
|
|
||||||
4
unittests/transform-matrix-is-identity.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(1 0 0 1 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 212 B |
5
unittests/transform-matrix-is-rotate-135.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(-0.70710678118654746 0.70710678118654757 -0.70710678118654757 -0.70710678118654746 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="rotate(135)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 367 B |
5
unittests/transform-matrix-is-rotate-45.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(0.70710678118654757 0.70710678118654746 -0.70710678118654746 0.70710678118654757 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="rotate(45)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 364 B |
5
unittests/transform-matrix-is-rotate-90.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(0 1 -1 0 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="rotate(90)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 292 B |
5
unittests/transform-matrix-is-rotate-neg-135.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(-0.70710678118654746 -0.70710678118654757 0.70710678118654757 -0.70710678118654746 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="rotate(-135)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 368 B |
5
unittests/transform-matrix-is-rotate-neg-45.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(0.70710678118654757 -0.70710678118654746 0.70710678118654746 0.70710678118654757 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="rotate(-45)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 365 B |
5
unittests/transform-matrix-is-rotate-neg-90.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(0 -1 1 0 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="rotate(-90)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 293 B |
4
unittests/transform-matrix-is-scale-2-3.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 18 27">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(2 0 0 3 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="scale(2 3)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 237 B |
5
unittests/transform-matrix-is-scale-neg-1.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 -9 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(-1 0 0 -1 0 0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="scale(-1)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 293 B |
4
unittests/transform-matrix-is-translate.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="2 3 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="matrix(1 0 0 1 2 3)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="translate(2 3)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 239 B |
6
unittests/transform-rotate-fold-3args.svg
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="rotate(90 0 0.0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9" transform="rotate(90)"/>
|
||||||
|
<!-- optional zero trailing args to transform type rotate get removed -->
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 364 B |
3
unittests/transform-rotate-is-identity.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 9 9">
|
||||||
|
<line transform="rotate(-300) rotate(-60)" stroke="red" y1="9" x1="9"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 153 B |
5
unittests/transform-translate-is-identity.svg
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-9 0 9 9">
|
||||||
|
<line stroke="rgba(255,0,0,0.5)" y1="9" x1="9" transform="translate(0, 20) translate(10) translate(-10 -20.0)"/>
|
||||||
|
<line stroke="rgba(0,0,255,0.5)" y1="9" x1="9"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 300 B |