From 21295c5ab5567126c3112b9417f68c76b4f6debf Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Tue, 24 Jun 2014 10:33:49 -0400 Subject: Docx reader: add failing tests for inline code and code blocks. --- tests/Tests/Readers/Docx.hs | 9 +++++++++ tests/docx.codeblock.docx | Bin 0 -> 8465 bytes tests/docx.codeblock.native | 3 +++ tests/docx.inline_code.docx | Bin 0 -> 8379 bytes tests/docx.inline_code.native | 1 + 5 files changed, 13 insertions(+) create mode 100644 tests/docx.codeblock.docx create mode 100644 tests/docx.codeblock.native create mode 100644 tests/docx.inline_code.docx create mode 100644 tests/docx.inline_code.native (limited to 'tests') diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index a42dc31e9..c49bee14e 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -86,6 +86,10 @@ tests = [ testGroup "inlines" "move trailing spaces outside of formatting" "docx.trailing_spaces_in_formatting.docx" "docx.trailing_spaces_in_formatting.native" + , testCompare + "inline code (with VerbatimChar style)" + "docx.inline_code.docx" + "docx.inline_code.native" ] , testGroup "blocks" [ testCompare @@ -108,6 +112,11 @@ tests = [ testGroup "inlines" "tables" "docx.tables.docx" "docx.tables.native" + , testCompare + "code block" + "docx.codeblock.docx" + "docx.codeblock.native" + ] ] diff --git a/tests/docx.codeblock.docx b/tests/docx.codeblock.docx new file mode 100644 index 000000000..8ec00953c Binary files /dev/null and b/tests/docx.codeblock.docx differ diff --git a/tests/docx.codeblock.native b/tests/docx.codeblock.native new file mode 100644 index 000000000..441e33511 --- /dev/null +++ b/tests/docx.codeblock.native @@ -0,0 +1,3 @@ +[Para [Str "This",Space,Str "is",Space,Str "some",Space,Str "code:"] +,CodeBlock ("",[],[]) "readDocx :: ReaderOptions\n -> B.ByteString\n -> Pandoc" +,Para [Str "from",Space,Str "the",Space,Str "beginning",Space,Str "of",Space,Str "the",Space,Str "docx",Space,Str "reader."]] diff --git a/tests/docx.inline_code.docx b/tests/docx.inline_code.docx new file mode 100644 index 000000000..75c5ea3cb Binary files /dev/null and b/tests/docx.inline_code.docx differ diff --git a/tests/docx.inline_code.native b/tests/docx.inline_code.native new file mode 100644 index 000000000..11cf2777c --- /dev/null +++ b/tests/docx.inline_code.native @@ -0,0 +1 @@ +[Para [Str "This",Space,Str "is",Space,Str "an",Space,Str "example",Space,Str "of",Space,Code ("",[],[]) "inline code",Space,Str "with",Space,Str "three",Space,Str "spaces."]] -- cgit v1.2.3 From 2621482d69d96a7f069133e57f6df8a479ad5111 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Tue, 24 Jun 2014 11:48:23 -0400 Subject: Docx Reader: add failing defintion list tests. --- tests/Tests/Readers/Docx.hs | 4 ++++ tests/docx.definition_list.docx | Bin 0 -> 8455 bytes tests/docx.definition_list.native | 7 +++++++ 3 files changed, 11 insertions(+) create mode 100644 tests/docx.definition_list.docx create mode 100644 tests/docx.definition_list.native (limited to 'tests') diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index c49bee14e..4d062bbc0 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -100,6 +100,10 @@ tests = [ testGroup "inlines" "lists" "docx.lists.docx" "docx.lists.native" + , testCompare + "definition lists" + "docx.definition_list.docx" + "docx.definition_list.native" , testCompare "footnotes and endnotes" "docx.notes.docx" diff --git a/tests/docx.definition_list.docx b/tests/docx.definition_list.docx new file mode 100644 index 000000000..a19edda45 Binary files /dev/null and b/tests/docx.definition_list.docx differ diff --git a/tests/docx.definition_list.native b/tests/docx.definition_list.native new file mode 100644 index 000000000..2e08ff1ac --- /dev/null +++ b/tests/docx.definition_list.native @@ -0,0 +1,7 @@ +[DefinitionList + [([Str "Term",Space,Str "1"], + [[Para [Str "Definition",Space,Str "1"]]]) + ,([Str "Term",Space,Str "2",Space,Str "with",Space,Emph [Str "inline",Space,Str "markup"]], + [[Para [Str "Definition",Space,Str "2"] + ,CodeBlock ("",[],[]) "{ some code, part of Definition 2 }" + ,Para [Str "Third",Space,Str "paragraph",Space,Str "of",Space,Str "definition",Space,Str "2."]]])]] -- cgit v1.2.3