Skip to content

Commit de96454

Browse files
committed
test(docx): add test for SVG DPI
This will check that the appropriate fallback PNGs are generated Signed-off-by: Edwin Török <[email protected]>
1 parent 0892709 commit de96454

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

test/Tests/Writers/Docx.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ tests = [ testGroup "inlines"
2424
def
2525
"docx/inline_formatting.native"
2626
"docx/golden/inline_formatting.docx"
27+
, docxTest
28+
"SVG image DPI"
29+
def{writerDpi=192} -- for HiDPI screens
30+
"docx/img.native"
31+
"docx/golden/img.docx"
2732
, docxTest
2833
"hyperlinks"
2934
def

test/docx/golden/img.docx

152 KB
Binary file not shown.

test/docx/img.native

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[ Figure
2+
( "" , [] , [] )
3+
(Caption Nothing [ Plain [ Str "5in" ] ])
4+
[ Plain
5+
[ Image
6+
( "" , [] , [ ( "width" , "5in" ) ] )
7+
[ Str "5in" ]
8+
( "command/SVG_logo.svg" , "" )
9+
]
10+
]
11+
, Figure
12+
( "" , [] , [] )
13+
(Caption Nothing [ Plain [ Str "5in" ] ])
14+
[ Plain
15+
[ Image
16+
( "" , [] , [ ( "width" , "5in" ) ] )
17+
[ Str "5in" ]
18+
( "command/SVG_logo.svg" , "" )
19+
]
20+
]
21+
, Figure
22+
( "" , [] , [] )
23+
(Caption Nothing [ Plain [ Str "80%" ] ])
24+
[ Plain
25+
[ Image
26+
( "" , [] , [ ( "width" , "80%" ) ] )
27+
[ Str "5in" ]
28+
( "command/SVG_logo.svg" , "" )
29+
]
30+
]
31+
, Figure
32+
( "" , [] , [] )
33+
(Caption Nothing [ Plain [ Str "default" ] ])
34+
[ Plain
35+
[ Image
36+
( "" , [] , [] )
37+
[ Str "5in" ]
38+
( "command/SVG_logo.svg" , "" )
39+
]
40+
]
41+
]

0 commit comments

Comments
 (0)