git.iko.soy/typeable/pandoc
on master help sign in
Docx: Add dropcap tests.
0808449Jesse Rosenthal
pandoc.cabal+1
@@ -177,6 +177,7 @@ Extra-Source-Files:
177 tests/docx.codeblock.docx,
177 tests/docx.codeblock.docx,
178 tests/docx.deep_normalize.docx,
178 tests/docx.deep_normalize.docx,
179 tests/docx.definition_list.docx,
179 tests/docx.definition_list.docx,
180+ tests/docx.drop_cap.docx,
180 tests/docx.hanging_indent.docx,
181 tests/docx.hanging_indent.docx,
181 tests/docx.headers.docx,
182 tests/docx.headers.docx,
182 tests/docx.image.docx,
183 tests/docx.image.docx,
tests/Tests/Readers/Docx.hs+6−4
@@ -82,14 +82,14 @@ compareMediaBagIO docxFile = do
82 df <- B.readFile docxFile
82 df <- B.readFile docxFile
83 let (_, mb) = readDocx def df
83 let (_, mb) = readDocx def df
84 bools <- mapM
84 bools <- mapM
85− (\(fp, _, _) -> compareMediaPathIO fp mb docxFile)
85+ (\(fp, _, _) -> compareMediaPathIO fp mb docxFile)
86 (mediaDirectory mb)
86 (mediaDirectory mb)
87 return $ and bools
87 return $ and bools
88
88
89testMediaBagIO :: String -> FilePath -> IO Test
89testMediaBagIO :: String -> FilePath -> IO Test
90testMediaBagIO name docxFile = do
90testMediaBagIO name docxFile = do
91 outcome <- compareMediaBagIO docxFile
91 outcome <- compareMediaBagIO docxFile
92− return $ testCase name (assertBool
92+ return $ testCase name (assertBool
93 ("Media didn't match media bag in file " ++ docxFile)
93 ("Media didn't match media bag in file " ++ docxFile)
94 outcome)
94 outcome)
95
95
@@ -176,7 +176,10 @@ tests = [ testGroup "inlines"
176 "code block"
176 "code block"
177 "docx.codeblock.docx"
177 "docx.codeblock.docx"
178 "docx.codeblock.native"
178 "docx.codeblock.native"
179−
179+ , testCompare
180+ "dropcap paragraphs"
181+ "docx.drop_cap.docx"
182+ "docx.drop_cap.native"
180 ]
183 ]
181 , testGroup "track changes"
184 , testGroup "track changes"
182 [ testCompare
185 [ testCompare
@@ -229,4 +232,3 @@ tests = [ testGroup "inlines"
229 ]
232 ]
230
233
231 ]
234 ]
232−
tests/docx.drop_cap.docxnew file

Binary file not shown.

tests/docx.drop_cap.nativenew file+4
@@ -0,0 +1,4 @@
1+[Para [Str "D",Str "rop",Space,Str "cap."]
2+,Para [Str "Next",Space,Str "paragraph."]
3+,Para [Str "D",Str "rop",Space,Str "cap",Space,Str "in",Space,Str "margin."]
4+,Para [Str "Drop",Space,Str "cap",Space,Str "(not",Space,Str "really)."]]