HTML, Muse reader tests: reduce time taken by round-trip test.

This commit is contained in:
John MacFarlane 2018-09-27 09:45:46 -07:00
parent b69f7d8810
commit 13f8f3c1a8
2 changed files with 6 additions and 4 deletions

View file

@ -31,12 +31,14 @@ removeRawInlines x = x
roundTrip :: Blocks -> Bool
roundTrip b = d'' == d'''
where d = walk removeRawInlines $ walk makeRoundTrip $ Pandoc nullMeta $ toList b
where d = walk removeRawInlines $
walk makeRoundTrip $ Pandoc nullMeta $ toList b
d' = rewrite d
d'' = rewrite d'
d''' = rewrite d''
rewrite = html . T.pack . (++ "\n") . T.unpack .
purely (writeHtml5String def { writerWrapText = WrapPreserve })
purely (writeHtml5String def
{ writerWrapText = WrapPreserve })
tests :: [TestTree]
tests = [ testGroup "base tag"
@ -75,5 +77,5 @@ tests = [ testGroup "base tag"
, test htmlNativeDivs "<main> followed by text" $ "<main>main content</main>non-main content" =?>
doc (divWith ("", [], [("role", "main")]) (plain (text "main content")) <> plain (text "non-main content"))
]
, testProperty "Round trip" roundTrip
, testProperty "Round trip" (withMaxSuccess 25 roundTrip)
]

View file

@ -260,7 +260,7 @@ tests =
]
, testGroup "Blocks"
[ testProperty "Round trip" roundTrip
[ testProperty "Round trip" (withMaxSuccess 25 roundTrip)
, "Block elements end paragraphs" =:
T.unlines [ "First paragraph"
, "----"