Powerpoint tests: shorten lines by grouping tests

This makes the test output more pleasant to read in narrow terminal
windows.
This commit is contained in:
Albert Krewinkel 2021-12-10 18:10:36 +01:00
parent 3e7b46af64
commit a64ea18647
No known key found for this signature in database
GPG key ID: 388DC0B21F631124

View file

@ -1,5 +1,6 @@
module Tests.Writers.Powerpoint (tests) where
import Control.Arrow ((***))
import Tests.Writers.OOXML (ooxmlTest)
import Text.Pandoc
import Test.Tasty
@ -42,11 +43,14 @@ groupPptxTests pairs =
, testGroup "With `--reference-doc` pptx file" refs
]
testGroup' :: String -> [(TestTree, TestTree)] -> (TestTree, TestTree)
testGroup' descr = (testGroup descr *** testGroup descr) . unzip
tests :: [TestTree]
tests = let
regularTests =
groupPptxTests [ pptxTests "Inline formatting"
regularTests = groupPptxTests
[ pptxTests "Inline formatting"
def
"pptx/inline-formatting/input.native"
"pptx/inline-formatting/output.pptx"
@ -139,88 +143,81 @@ tests = let
[(pack "monofont", toVal $ pack "Consolas")] }
"pptx/code/input.native"
"pptx/code-custom/output.pptx"
, pptxTests ("Using slide level 0, if the first thing on "
<> "a slide is a h1 it's used as the "
<> "slide title")
, testGroup' "Using slide level 0, if the first thing on a slide is"
[ pptxTests ("a h1 it's used as the slide title")
def { writerSlideLevel = Just 0 }
"pptx/slide-level-0/h1-with-image/input.native"
"pptx/slide-level-0/h1-with-image/output.pptx"
, pptxTests ("Using slide level 0, if the first thing on "
<> "a slide is a h2 it's used as the "
, pptxTests ("a h2 it's used as the "
<> "slide title")
def { writerSlideLevel = Just 0 }
"pptx/slide-level-0/h2-with-image/input.native"
"pptx/slide-level-0/h2-with-image/output.pptx"
, pptxTests ("Using slide level 0, if the first thing on "
<> "a slide is a heading it's used as the "
<> "slide title (works with a table)")
, testGroup' "a heading it's used as the slide title"
[ pptxTests "(works with a table)"
def { writerSlideLevel = Just 0 }
"pptx/slide-level-0/h1-with-table/input.native"
"pptx/slide-level-0/h1-with-table/output.pptx"
, pptxTests ("Using slide level 0, if the first thing on "
<> "a slide is a heading it's used as the "
<> "slide title (content with caption layout)")
, pptxTests ("(content with caption layout)")
def { writerSlideLevel = Just 0 }
"pptx/slide-level-0/h1-h2-with-table/input.native"
"pptx/slide-level-0/h1-h2-with-table/output.pptx"
, pptxTests ("comparison layout used when two columns "
<> "contain text plus non-text")
]
]
, testGroup' "comparison layout"
[ testGroup' "comparison layout is used..."
[ pptxTests "when two columns contain text + non-text"
def
"pptx/comparison/both-columns/input.native"
"pptx/comparison/both-columns/output.pptx"
, pptxTests ("comparison layout used even when only one "
<> "column contains text plus non-text")
, pptxTests "even when only one col contains text + non-text"
def
"pptx/comparison/one-column/input.native"
"pptx/comparison/one-column/output.pptx"
, pptxTests ("extra text in one column in comparison "
<> "layout gets overlaid")
]
, testGroup' "extra ... in one column gets overlaid"
[ pptxTests "text"
def
"pptx/comparison/extra-text/input.native"
"pptx/comparison/extra-text/output.pptx"
, pptxTests ("extra image in one column in comparison "
<> "layout gets overlaid")
, pptxTests "image"
def
"pptx/comparison/extra-image/input.native"
"pptx/comparison/extra-image/output.pptx"
, pptxTests "comparison not used if the non-text comes first"
]
, pptxTests "is not used if the non-text comes first"
def
"pptx/comparison/non-text-first/input.native"
"pptx/comparison/non-text-first/output.pptx"
, pptxTests ("Heading, text and an image on the same "
<> "slide uses the Content with Caption "
<> "layout")
]
, testGroup' "Content with Caption layout is ..."
[ pptxTests "used for heading, text, image on the same slide"
def
"pptx/content-with-caption/heading-text-image/input.native"
"pptx/content-with-caption/heading-text-image/output.pptx"
, pptxTests ("Text and an image on the same "
<> "slide uses the Content with Caption "
<> "layout")
, pptxTests "used for text and an image on the same slide"
def
"pptx/content-with-caption/text-image/input.native"
"pptx/content-with-caption/text-image/output.pptx"
, pptxTests ("If the image comes first, Content with "
<> "Caption is not used")
, pptxTests "not used if the image comes first"
def
"pptx/content-with-caption/image-text/input.native"
"pptx/content-with-caption/image-text/output.pptx"
, pptxTests ("If a slide contains only speaker notes, the "
<> "Blank layout is used")
]
, testGroup' "The Blank layout is used if a slide contains only..."
[ pptxTests "speaker notes"
def
"pptx/blanks/just-speaker-notes/input.native"
"pptx/blanks/just-speaker-notes/output.pptx"
, pptxTests ("If a slide contains only an empty heading "
<> "with a body of only non-breaking spaces"
<> ", the Blank layout is used")
, pptxTests "an empty heading with a body of only NBSPs"
def
"pptx/blanks/nbsp-in-body/input.native"
"pptx/blanks/nbsp-in-body/output.pptx"
, pptxTests ("If a slide contains only a heading "
<> "containing only non-breaking spaces, "
<> "the Blank layout is used")
, pptxTests "a heading containing only non-breaking spaces"
def
"pptx/blanks/nbsp-in-heading/input.native"
"pptx/blanks/nbsp-in-heading/output.pptx"
]
, pptxTests ("Incremental lists are supported")
def { writerIncremental = True }
"pptx/incremental-lists/with-flag/input.native"