Skip to content

Commit

Permalink
test(docx): add test for SVG DPI
Browse files Browse the repository at this point in the history
This will check that the appropriate fallback PNGs are generated

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Dec 27, 2023
1 parent 0892709 commit de96454
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/Tests/Writers/Docx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ tests = [ testGroup "inlines"
def
"docx/inline_formatting.native"
"docx/golden/inline_formatting.docx"
, docxTest
"SVG image DPI"
def{writerDpi=192} -- for HiDPI screens
"docx/img.native"
"docx/golden/img.docx"
, docxTest
"hyperlinks"
def
Expand Down
Binary file added test/docx/golden/img.docx
Binary file not shown.
41 changes: 41 additions & 0 deletions test/docx/img.native
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[ Figure
( "" , [] , [] )
(Caption Nothing [ Plain [ Str "5in" ] ])
[ Plain
[ Image
( "" , [] , [ ( "width" , "5in" ) ] )
[ Str "5in" ]
( "command/SVG_logo.svg" , "" )
]
]
, Figure
( "" , [] , [] )
(Caption Nothing [ Plain [ Str "5in" ] ])
[ Plain
[ Image
( "" , [] , [ ( "width" , "5in" ) ] )
[ Str "5in" ]
( "command/SVG_logo.svg" , "" )
]
]
, Figure
( "" , [] , [] )
(Caption Nothing [ Plain [ Str "80%" ] ])
[ Plain
[ Image
( "" , [] , [ ( "width" , "80%" ) ] )
[ Str "5in" ]
( "command/SVG_logo.svg" , "" )
]
]
, Figure
( "" , [] , [] )
(Caption Nothing [ Plain [ Str "default" ] ])
[ Plain
[ Image
( "" , [] , [] )
[ Str "5in" ]
( "command/SVG_logo.svg" , "" )
]
]
]

0 comments on commit de96454

Please sign in to comment.