From 7980631a0b0f8508a8f8d74419d9f740a40e524c Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Thu, 23 Jun 2016 10:46:01 -0400 Subject: Docx reader: add tests for comments We test for comments, using all track-changes options. Note that we should only output comments if `--track-changes=all`. We also test for emitting warnings if there is complicated formatting. --- tests/docx/comments.docx | Bin 0 -> 17109 bytes tests/docx/comments.native | 4 ++++ tests/docx/comments_no_comments.native | 4 ++++ tests/docx/comments_warning.docx | Bin 0 -> 17078 bytes 4 files changed, 8 insertions(+) create mode 100644 tests/docx/comments.docx create mode 100644 tests/docx/comments.native create mode 100644 tests/docx/comments_no_comments.native create mode 100644 tests/docx/comments_warning.docx (limited to 'tests/docx') diff --git a/tests/docx/comments.docx b/tests/docx/comments.docx new file mode 100644 index 000000000..9df74cf0a Binary files /dev/null and b/tests/docx/comments.docx differ diff --git a/tests/docx/comments.native b/tests/docx/comments.native new file mode 100644 index 000000000..3357bc257 --- /dev/null +++ b/tests/docx/comments.native @@ -0,0 +1,4 @@ +[Para [Str "I",Space,Str "want",Space,Span ("",["comment-start"],[("id","0"),("author","Jesse Rosenthal"),("date","2016-05-09T16:13:00Z")]) [Str "I",Space,Str "left",Space,Str "a",Space,Str "comment."],Str "some",Space,Str "text",Space,Str "to",Space,Str "have",Space,Str "a",Space,Str "comment",Space,Span ("",["comment-end"],[("id","0")]) [],Str "on",Space,Str "it."] +,Para [Str "This",Space,Str "is",Space,Span ("",["comment-start"],[("id","1"),("author","Jesse Rosenthal"),("date","2016-05-09T16:13:00Z")]) [Str "A",Space,Str "comment",Space,Str "across",Space,Str "paragraphs."],Str "a",Space,Str "new",Space,Str "paragraph."] +,Para [Str "And",Space,Str "so",Span ("",["comment-end"],[("id","1")]) [],Space,Str "is",Space,Str "this."] +,Para [Str "One",Space,Span ("",["comment-start"],[("id","2"),("author","Jesse Rosenthal"),("date","2016-05-09T16:14:00Z")]) [Str "This",Space,Str "one",Space,Str "has",Space,Str "multiple",Space,Str "paragraphs.",Space,Str "\182",Space,Str "See?"],Str "more",Span ("",["comment-end"],[("id","2")]) [],Str ".",Space,Str "And",Space,Str "this",Space,Str "is",Space,Str "one",Space,Str "with",Space,Str "a",Space,Span ("",["comment-start"],[("id","3"),("author","Jesse Rosenthal"),("date","2016-06-22T14:35:00Z")]) [Str "Do",Space,Str "something."],Span ("",["comment-start"],[("id","4"),("author","Jesse Rosenthal"),("date","2016-06-22T14:36:00Z")]) [Str "Do",Space,Str "something",Space,Str "else."],Str "comment",Space,Str "in",Space,Str "a",Space,Str "comment",Span ("",["comment-end"],[("id","3")]) [Span ("",["comment-end"],[("id","4")]) []],Str "."]] diff --git a/tests/docx/comments_no_comments.native b/tests/docx/comments_no_comments.native new file mode 100644 index 000000000..805e9b562 --- /dev/null +++ b/tests/docx/comments_no_comments.native @@ -0,0 +1,4 @@ +[Para [Str "I",Space,Str "want",Space,Str "some",Space,Str "text",Space,Str "to",Space,Str "have",Space,Str "a",Space,Str "comment",Space,Str "on",Space,Str "it."] +,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "new",Space,Str "paragraph."] +,Para [Str "And",Space,Str "so",Space,Str "is",Space,Str "this."] +,Para [Str "One",Space,Str "more.",Space,Str "And",Space,Str "this",Space,Str "is",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "comment",Space,Str "in",Space,Str "a",Space,Str "comment."]] diff --git a/tests/docx/comments_warning.docx b/tests/docx/comments_warning.docx new file mode 100644 index 000000000..e49642b22 Binary files /dev/null and b/tests/docx/comments_warning.docx differ -- cgit v1.2.3