From 54526525bf2035b8517a8abf45def9c4aaa9444c Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Sun, 21 Jan 2018 00:25:03 -0500 Subject: Powerpoint writer tests: New test framework for pptx. Previously we had tested certain properties of the output PowerPoint slides. Corruption, though, comes as the result of a numebr of interrelated issues in the output pptx archive. This is a new approach, which compares the output of the Powerpoint writer with files that we know to (a) not be corrupt, and (b) to show the desired output behavior (details below). This commit introduces three tests using the new framework. More will follow. The test procedure: given a native file and a pptx file, we generate a pptx archive from the native file, and then test: 1. Whether the same files are in the two archives 2. Whether each of the contained xml files is the same. (We skip time entries in `docProps/core.xml`, since these are derived from IO. We just check to make sure that they're there in the same way in both files.) 3. Whether each of the media files is the same. Note that steps 2 and 3, though they compare multiple files, are one test each, since the number of files depends on the input file (if there is a failure, it will only report the first failed file comparison in the test failure). --- test/pptx/inline_formatting.native | 5 +++++ test/pptx/inline_formatting.pptx | Bin 0 -> 25582 bytes test/pptx/slide_breaks.native | 7 +++++++ test/pptx/slide_breaks.pptx | Bin 0 -> 28032 bytes test/pptx/slide_breaks_slide_level_1.pptx | Bin 0 -> 27202 bytes 5 files changed, 12 insertions(+) create mode 100644 test/pptx/inline_formatting.native create mode 100644 test/pptx/inline_formatting.pptx create mode 100644 test/pptx/slide_breaks.native create mode 100644 test/pptx/slide_breaks.pptx create mode 100644 test/pptx/slide_breaks_slide_level_1.pptx (limited to 'test/pptx') diff --git a/test/pptx/inline_formatting.native b/test/pptx/inline_formatting.native new file mode 100644 index 000000000..d79220e4f --- /dev/null +++ b/test/pptx/inline_formatting.native @@ -0,0 +1,5 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "Here",Space,Str "are",Space,Str "examples",Space,Str "of",Space,Emph [Str "italics"],Str ",",Space,Strong [Str "bold"],Str ",",Space,Str "and",Space,Strong [Emph [Str "bold",Space,Str "italics"]],Str "."] +,Para [Str "Here",Space,Str "is",Space,Strikeout [Str "strook-three"],Space,Str "strike-through",Space,Str "and",Space,SmallCaps [Str "small",Space,Str "caps"],Str "."] +,Para [Str "We",Space,Str "can",Space,Str "also",Space,Str "do",Space,Str "subscripts",Space,Str "(H",Subscript [Str "2"],Str "0)",Space,Str "and",Space,Str "super",Superscript [Str "script"],Str "."] +,RawBlock (Format "html") ""] diff --git a/test/pptx/inline_formatting.pptx b/test/pptx/inline_formatting.pptx new file mode 100644 index 000000000..e128f1bce Binary files /dev/null and b/test/pptx/inline_formatting.pptx differ diff --git a/test/pptx/slide_breaks.native b/test/pptx/slide_breaks.native new file mode 100644 index 000000000..084c61737 --- /dev/null +++ b/test/pptx/slide_breaks.native @@ -0,0 +1,7 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "Break",Space,Str "with",Space,Str "a",Space,Str "new",Space,Str "section-level",Space,Str "header"] +,Header 1 ("below-section-level",[],[]) [Str "Below",Space,Str "section-level"] +,Header 2 ("section-level",[],[]) [Str "Section-level"] +,Para [Str "Third",Space,Str "slide",Space,Str "(with",Space,Str "a",Space,Str "section-level",Space,Str "of",Space,Str "2)"] +,HorizontalRule +,Para [Str "This",Space,Str "is",Space,Str "another",Space,Str "slide."]] diff --git a/test/pptx/slide_breaks.pptx b/test/pptx/slide_breaks.pptx new file mode 100644 index 000000000..b22b0bc50 Binary files /dev/null and b/test/pptx/slide_breaks.pptx differ diff --git a/test/pptx/slide_breaks_slide_level_1.pptx b/test/pptx/slide_breaks_slide_level_1.pptx new file mode 100644 index 000000000..d4d7bc415 Binary files /dev/null and b/test/pptx/slide_breaks_slide_level_1.pptx differ -- cgit v1.2.3