@@ -108,6 +108,33 @@ 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+ , "Image with options with spaces" =:
134+ "\\includegraphics[width=12cm, height = 5cm]{foo.png}" =?>
135+ para (imageWith ("", [], [("width", "12cm"), ("height", "5cm")]) "foo.png" "" "image")
136+ ]
137+
111138 , let hex = ['0'..'9']++['a'..'f'] in
112139 testGroup "Character Escapes"
113140 [ "Two-character escapes" =: