From b3449a84aa19edd3b31e2f49fddb924b54d99df6 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Fri, 26 Jan 2018 14:23:18 -0500 Subject: Docx writer tests: Use new golden framework These are based off the reader tests, with some removed (where the reader output was identical, based on different docx inputs). There are still more to be added. In particular, tests for custom-styles need to be added. All golden docx files have been checked in MS Word 2013 (windows). There is no corruption. There is questionable output in the `tables` test: the three tables seemed to be joined. This will be addressed in a future commit, and the golden docx file will be changed. --- test/docx/golden/block_quotes.docx | Bin 0 -> 9778 bytes test/docx/golden/codeblock.docx | Bin 0 -> 9638 bytes test/docx/golden/comments.docx | Bin 0 -> 9960 bytes test/docx/golden/definition_list.docx | Bin 0 -> 9617 bytes test/docx/golden/headers.docx | Bin 0 -> 9765 bytes test/docx/golden/image.docx | Bin 0 -> 26296 bytes test/docx/golden/inline_code.docx | Bin 0 -> 9560 bytes test/docx/golden/inline_formatting.docx | Bin 0 -> 9737 bytes test/docx/golden/inline_images.docx | Bin 0 -> 26460 bytes test/docx/golden/link_in_notes.docx | Bin 0 -> 9781 bytes test/docx/golden/links.docx | Bin 0 -> 9960 bytes test/docx/golden/lists.docx | Bin 0 -> 10031 bytes test/docx/golden/lists_continuing.docx | Bin 0 -> 9830 bytes test/docx/golden/lists_restarting.docx | Bin 0 -> 9830 bytes test/docx/golden/nested_anchors_in_header.docx | Bin 0 -> 9882 bytes test/docx/golden/notes.docx | Bin 0 -> 9731 bytes test/docx/golden/table_one_row.docx | Bin 0 -> 9581 bytes test/docx/golden/table_with_list_cell.docx | Bin 0 -> 9948 bytes test/docx/golden/tables.docx | Bin 0 -> 9963 bytes test/docx/golden/track_changes_deletion.docx | Bin 0 -> 9604 bytes test/docx/golden/track_changes_insertion.docx | Bin 0 -> 9587 bytes test/docx/golden/track_changes_move.docx | Bin 0 -> 9621 bytes test/docx/golden/unicode.docx | Bin 0 -> 9545 bytes test/docx/golden/verbatim_subsuper.docx | Bin 0 -> 9593 bytes test/docx/image_writer_test.native | 5 +++++ test/docx/inline_images_writer_test.native | 2 ++ 26 files changed, 7 insertions(+) create mode 100644 test/docx/golden/block_quotes.docx create mode 100644 test/docx/golden/codeblock.docx create mode 100644 test/docx/golden/comments.docx create mode 100644 test/docx/golden/definition_list.docx create mode 100644 test/docx/golden/headers.docx create mode 100644 test/docx/golden/image.docx create mode 100644 test/docx/golden/inline_code.docx create mode 100644 test/docx/golden/inline_formatting.docx create mode 100644 test/docx/golden/inline_images.docx create mode 100644 test/docx/golden/link_in_notes.docx create mode 100644 test/docx/golden/links.docx create mode 100644 test/docx/golden/lists.docx create mode 100644 test/docx/golden/lists_continuing.docx create mode 100644 test/docx/golden/lists_restarting.docx create mode 100644 test/docx/golden/nested_anchors_in_header.docx create mode 100644 test/docx/golden/notes.docx create mode 100644 test/docx/golden/table_one_row.docx create mode 100644 test/docx/golden/table_with_list_cell.docx create mode 100644 test/docx/golden/tables.docx create mode 100644 test/docx/golden/track_changes_deletion.docx create mode 100644 test/docx/golden/track_changes_insertion.docx create mode 100644 test/docx/golden/track_changes_move.docx create mode 100644 test/docx/golden/unicode.docx create mode 100644 test/docx/golden/verbatim_subsuper.docx create mode 100644 test/docx/image_writer_test.native create mode 100644 test/docx/inline_images_writer_test.native (limited to 'test/docx') diff --git a/test/docx/golden/block_quotes.docx b/test/docx/golden/block_quotes.docx new file mode 100644 index 000000000..28d6f035e Binary files /dev/null and b/test/docx/golden/block_quotes.docx differ diff --git a/test/docx/golden/codeblock.docx b/test/docx/golden/codeblock.docx new file mode 100644 index 000000000..af85598dc Binary files /dev/null and b/test/docx/golden/codeblock.docx differ diff --git a/test/docx/golden/comments.docx b/test/docx/golden/comments.docx new file mode 100644 index 000000000..33831dc06 Binary files /dev/null and b/test/docx/golden/comments.docx differ diff --git a/test/docx/golden/definition_list.docx b/test/docx/golden/definition_list.docx new file mode 100644 index 000000000..c3f076387 Binary files /dev/null and b/test/docx/golden/definition_list.docx differ diff --git a/test/docx/golden/headers.docx b/test/docx/golden/headers.docx new file mode 100644 index 000000000..c2b6206a3 Binary files /dev/null and b/test/docx/golden/headers.docx differ diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx new file mode 100644 index 000000000..dc49f266b Binary files /dev/null and b/test/docx/golden/image.docx differ diff --git a/test/docx/golden/inline_code.docx b/test/docx/golden/inline_code.docx new file mode 100644 index 000000000..1d415e411 Binary files /dev/null and b/test/docx/golden/inline_code.docx differ diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx new file mode 100644 index 000000000..367654e53 Binary files /dev/null and b/test/docx/golden/inline_formatting.docx differ diff --git a/test/docx/golden/inline_images.docx b/test/docx/golden/inline_images.docx new file mode 100644 index 000000000..6bd4b3a34 Binary files /dev/null and b/test/docx/golden/inline_images.docx differ diff --git a/test/docx/golden/link_in_notes.docx b/test/docx/golden/link_in_notes.docx new file mode 100644 index 000000000..c86f9aecd Binary files /dev/null and b/test/docx/golden/link_in_notes.docx differ diff --git a/test/docx/golden/links.docx b/test/docx/golden/links.docx new file mode 100644 index 000000000..652a93569 Binary files /dev/null and b/test/docx/golden/links.docx differ diff --git a/test/docx/golden/lists.docx b/test/docx/golden/lists.docx new file mode 100644 index 000000000..5e900feb1 Binary files /dev/null and b/test/docx/golden/lists.docx differ diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx new file mode 100644 index 000000000..278edaa99 Binary files /dev/null and b/test/docx/golden/lists_continuing.docx differ diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx new file mode 100644 index 000000000..112b824b5 Binary files /dev/null and b/test/docx/golden/lists_restarting.docx differ diff --git a/test/docx/golden/nested_anchors_in_header.docx b/test/docx/golden/nested_anchors_in_header.docx new file mode 100644 index 000000000..c2a10b828 Binary files /dev/null and b/test/docx/golden/nested_anchors_in_header.docx differ diff --git a/test/docx/golden/notes.docx b/test/docx/golden/notes.docx new file mode 100644 index 000000000..c6093c18a Binary files /dev/null and b/test/docx/golden/notes.docx differ diff --git a/test/docx/golden/table_one_row.docx b/test/docx/golden/table_one_row.docx new file mode 100644 index 000000000..34de65e2e Binary files /dev/null and b/test/docx/golden/table_one_row.docx differ diff --git a/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx new file mode 100644 index 000000000..c27f99736 Binary files /dev/null and b/test/docx/golden/table_with_list_cell.docx differ diff --git a/test/docx/golden/tables.docx b/test/docx/golden/tables.docx new file mode 100644 index 000000000..4fcdd73c3 Binary files /dev/null and b/test/docx/golden/tables.docx differ diff --git a/test/docx/golden/track_changes_deletion.docx b/test/docx/golden/track_changes_deletion.docx new file mode 100644 index 000000000..7b404dba1 Binary files /dev/null and b/test/docx/golden/track_changes_deletion.docx differ diff --git a/test/docx/golden/track_changes_insertion.docx b/test/docx/golden/track_changes_insertion.docx new file mode 100644 index 000000000..500a7c239 Binary files /dev/null and b/test/docx/golden/track_changes_insertion.docx differ diff --git a/test/docx/golden/track_changes_move.docx b/test/docx/golden/track_changes_move.docx new file mode 100644 index 000000000..05705c040 Binary files /dev/null and b/test/docx/golden/track_changes_move.docx differ diff --git a/test/docx/golden/unicode.docx b/test/docx/golden/unicode.docx new file mode 100644 index 000000000..c1626874d Binary files /dev/null and b/test/docx/golden/unicode.docx differ diff --git a/test/docx/golden/verbatim_subsuper.docx b/test/docx/golden/verbatim_subsuper.docx new file mode 100644 index 000000000..d2ada67fa Binary files /dev/null and b/test/docx/golden/verbatim_subsuper.docx differ diff --git a/test/docx/image_writer_test.native b/test/docx/image_writer_test.native new file mode 100644 index 000000000..a568cbca0 --- /dev/null +++ b/test/docx/image_writer_test.native @@ -0,0 +1,5 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Image ("",[],[]) [] ("lalune.jpg","")] +,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")] +,Header 1 ("one-more",[],[]) [Str "One",Space,Str "More"] +,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")]] \ No newline at end of file diff --git a/test/docx/inline_images_writer_test.native b/test/docx/inline_images_writer_test.native new file mode 100644 index 000000000..921a7aff8 --- /dev/null +++ b/test/docx/inline_images_writer_test.native @@ -0,0 +1,2 @@ +[Para [Str "This",Space,Str "picture",Space,Image ("",[],[("width","0.8888888888888888in"),("height","0.8888888888888888in")]) [Str "This",Space,Str "one",Space,Str "is",Space,Str "green",Space,Str "and",Space,Str "looks",Space,Str "like",Space,Str "Sideshow",Space,Str "Bob."] ("lalune.jpg","First identicon"),Space,Str "is",Space,Str "an",Space,Str "identicon."] +,Para [Str "Here",Space,Str "is",Space,Link ("",[],[]) [Str "one",Space,Image ("",[],[("width","0.8888888888888888in"),("height","0.8888888888888888in")]) [Str "This",Space,Str "one",Space,Str "is",Space,Str "reddish,",Space,Str "and",Space,Str "looks",Space,Str "like",Space,Str "a",Space,Str "heart",Space,Str "that",Space,Str "has",Space,Str "leaked",Space,Str "out."] ("lalune.jpg","Second identicon"),Space,Str "that"] ("http://www.google.com",""),Space,Str "links."]] -- cgit v1.2.3