Docx: Add dropcap tests.

This commit is contained in:
Jesse Rosenthal 2014-08-11 23:10:50 -04:00
parent 3e32cd5bb1
commit 0808449547
4 changed files with 11 additions and 4 deletions

View file

@ -177,6 +177,7 @@ Extra-Source-Files:
tests/docx.codeblock.docx,
tests/docx.deep_normalize.docx,
tests/docx.definition_list.docx,
tests/docx.drop_cap.docx,
tests/docx.hanging_indent.docx,
tests/docx.headers.docx,
tests/docx.image.docx,

View file

@ -82,14 +82,14 @@ compareMediaBagIO docxFile = do
df <- B.readFile docxFile
let (_, mb) = readDocx def df
bools <- mapM
(\(fp, _, _) -> compareMediaPathIO fp mb docxFile)
(\(fp, _, _) -> compareMediaPathIO fp mb docxFile)
(mediaDirectory mb)
return $ and bools
testMediaBagIO :: String -> FilePath -> IO Test
testMediaBagIO name docxFile = do
outcome <- compareMediaBagIO docxFile
return $ testCase name (assertBool
return $ testCase name (assertBool
("Media didn't match media bag in file " ++ docxFile)
outcome)
@ -176,7 +176,10 @@ tests = [ testGroup "inlines"
"code block"
"docx.codeblock.docx"
"docx.codeblock.native"
, testCompare
"dropcap paragraphs"
"docx.drop_cap.docx"
"docx.drop_cap.native"
]
, testGroup "track changes"
[ testCompare
@ -229,4 +232,3 @@ tests = [ testGroup "inlines"
]
]

BIN
tests/docx.drop_cap.docx Normal file

Binary file not shown.

View file

@ -0,0 +1,4 @@
[Para [Str "D",Str "rop",Space,Str "cap."]
,Para [Str "Next",Space,Str "paragraph."]
,Para [Str "D",Str "rop",Space,Str "cap",Space,Str "in",Space,Str "margin."]
,Para [Str "Drop",Space,Str "cap",Space,Str "(not",Space,Str "really)."]]