aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Firshman <ben@firshman.co.uk>2017-10-13 16:11:29 +0300
committerBen Firshman <ben@firshman.co.uk>2017-10-17 15:09:55 +0300
commitd73fdbf895758095f23f798dd233d36be5966f7f (patch)
tree7ac28345c18664bf699f59e0510a59d1314666b8
parentc2de9d749cbc21386e153a4f9efc3049a299cecc (diff)
downloadpandoc-d73fdbf895758095f23f798dd233d36be5966f7f.tar.gz
Add tests for existing \includegraphics behaviour
-rw-r--r--test/Tests/Readers/LaTeX.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs
index 1486ba415..8fedc0978 100644
--- a/test/Tests/Readers/LaTeX.hs
+++ b/test/Tests/Readers/LaTeX.hs
@@ -108,6 +108,30 @@ tests = [ testGroup "basic"
, biblatexCitations
]
+ , testGroup "images"
+ [ "Basic image" =:
+ "\\includegraphics{foo.png}" =?>
+ para (image "foo.png" "" (text "image"))
+ , "Basic image with blank options" =:
+ "\\includegraphics[]{foo.png}" =?>
+ para (image "foo.png" "" (text "image"))
+ , "Image with both width and height" =:
+ "\\includegraphics[width=17cm,height=5cm]{foo.png}" =?>
+ para (imageWith ("", [], [("width", "17cm"), ("height", "5cm")]) "foo.png" "" "image")
+ , "Image with width and height and a bunch of other options" =:
+ "\\includegraphics[width=17cm,height=5cm,clip,keepaspectratio]{foo.png}" =?>
+ para (imageWith ("", [], [("width", "17cm"), ("height", "5cm")]) "foo.png" "" "image")
+ , "Image with just width" =:
+ "\\includegraphics[width=17cm]{foo.png}" =?>
+ para (imageWith ("", [], [("width", "17cm")]) "foo.png" "" "image")
+ , "Image with just height" =:
+ "\\includegraphics[height=17cm]{foo.png}" =?>
+ para (imageWith ("", [], [("height", "17cm")]) "foo.png" "" "image")
+ , "Image width relative to textsize" =:
+ "\\includegraphics[width=0.6\\textwidth]{foo.png}" =?>
+ para (imageWith ("", [], [("width", "60%")]) "foo.png" "" "image")
+ ]
+
, let hex = ['0'..'9']++['a'..'f'] in
testGroup "Character Escapes"
[ "Two-character escapes" =: