mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-21 15:05:47 +00:00
More informative output on writer test failure.
This commit is contained in:
@@ -11,8 +11,8 @@ import Test.HUnit hiding (Test)
|
||||
|
||||
infix 8 -->
|
||||
|
||||
(-->) :: (Eq a, Show a) => a -> a -> Assertion
|
||||
a --> e = assertEqual " " e a
|
||||
(-->) :: (Eq a, Show a, Show b) => (b, a) -> a -> Assertion
|
||||
(b,a) --> e = assertEqual (show b) e a
|
||||
|
||||
-- In the first argument, the String is the input, and the Pandoc
|
||||
-- the output, of a pandoc reader. The input is shown in case
|
||||
|
||||
@@ -7,17 +7,17 @@ import Text.Pandoc
|
||||
import Text.Pandoc.Shared (removeTrailingSpace)
|
||||
import Tests.Helpers
|
||||
|
||||
inlines :: Inlines -> String
|
||||
inlines = removeTrailingSpace .
|
||||
writeConTeXt defaultWriterOptions . doc . plain
|
||||
inlines :: Inlines -> (Inlines, String)
|
||||
inlines ils = (ils, removeTrailingSpace .
|
||||
writeConTeXt defaultWriterOptions . doc . plain $ ils)
|
||||
|
||||
blocks :: Blocks -> String
|
||||
blocks = writeConTeXt defaultWriterOptions . doc
|
||||
blocks :: Blocks -> (Blocks, String)
|
||||
blocks bls = (bls, writeConTeXt defaultWriterOptions . doc $ bls)
|
||||
|
||||
tests :: [Test]
|
||||
tests = [ testGroup "inline code"
|
||||
[ "with '}'" =:
|
||||
inlines (code "}") --> "\\mono{\\letterclosebrace{}}"
|
||||
inlines (code "}") --> "\\mono{\\letterclosebrace{x}}"
|
||||
, "without '}'" =:
|
||||
inlines (code "]") --> "\\type{]}"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user