Skip to content

Commit

Permalink
HTML, Muse reader tests: reduce time taken by round-trip test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Sep 27, 2018
1 parent b69f7d8 commit 13f8f3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions test/Tests/Readers/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
]
2 changes: 1 addition & 1 deletion test/Tests/Readers/Muse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
, "----"
Expand Down

0 comments on commit 13f8f3c

Please sign in to comment.