git.iko.soy/typeable/pandoc
on master help sign in
Add tests for existing \includegraphics behaviour
commitd73fdbf895758095f23f798dd233d36be5966f7f authorBen Firshman <ben@firshman.co.uk> dateFri 13 Oct 2017, 16:11 (9 years ago) parentc2de9d7
1 file changed+24
test/Tests/Readers/LaTeX.hs+24
test/Tests/Readers/LaTeX.hs+24
@@ -108,6 +108,30 @@ tests = [ testGroup "basic"
108108 , biblatexCitations
109109 ]
110110
111+ , testGroup "images"
112+ [ "Basic image" =:
113+ "\\includegraphics{foo.png}" =?>
114+ para (image "foo.png" "" (text "image"))
115+ , "Basic image with blank options" =:
116+ "\\includegraphics[]{foo.png}" =?>
117+ para (image "foo.png" "" (text "image"))
118+ , "Image with both width and height" =:
119+ "\\includegraphics[width=17cm,height=5cm]{foo.png}" =?>
120+ para (imageWith ("", [], [("width", "17cm"), ("height", "5cm")]) "foo.png" "" "image")
121+ , "Image with width and height and a bunch of other options" =:
122+ "\\includegraphics[width=17cm,height=5cm,clip,keepaspectratio]{foo.png}" =?>
123+ para (imageWith ("", [], [("width", "17cm"), ("height", "5cm")]) "foo.png" "" "image")
124+ , "Image with just width" =:
125+ "\\includegraphics[width=17cm]{foo.png}" =?>
126+ para (imageWith ("", [], [("width", "17cm")]) "foo.png" "" "image")
127+ , "Image with just height" =:
128+ "\\includegraphics[height=17cm]{foo.png}" =?>
129+ para (imageWith ("", [], [("height", "17cm")]) "foo.png" "" "image")
130+ , "Image width relative to textsize" =:
131+ "\\includegraphics[width=0.6\\textwidth]{foo.png}" =?>
132+ para (imageWith ("", [], [("width", "60%")]) "foo.png" "" "image")
133+ ]
134+
111135 , let hex = ['0'..'9']++['a'..'f'] in
112136 testGroup "Character Escapes"
113137 [ "Two-character escapes" =: