Added Tests.Readers.Markdown.
This commit is contained in:
parent
f8dca6ccbc
commit
0acf774011
3 changed files with 32 additions and 0 deletions
|
@ -354,6 +354,7 @@ Executable test-pandoc
|
|||
Tests.Helpers
|
||||
Tests.Arbitrary
|
||||
Tests.Readers.LaTeX
|
||||
Tests.Readers.Markdown
|
||||
Tests.Readers.RST
|
||||
Tests.Writers.Native
|
||||
Tests.Writers.ConTeXt
|
||||
|
|
29
tests/Tests/Readers/Markdown.hs
Normal file
29
tests/Tests/Readers/Markdown.hs
Normal file
|
@ -0,0 +1,29 @@
|
|||
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
|
||||
module Tests.Readers.Markdown (tests) where
|
||||
|
||||
import Text.Pandoc.Definition
|
||||
import Test.Framework
|
||||
import Tests.Helpers
|
||||
import Tests.Arbitrary()
|
||||
import Text.Pandoc.Builder
|
||||
import Text.Pandoc
|
||||
|
||||
markdown :: String -> Pandoc
|
||||
markdown = readMarkdown defaultParserState{ stateStandalone = True }
|
||||
|
||||
infix 5 =:
|
||||
(=:) :: ToString c
|
||||
=> String -> (String, c) -> Test
|
||||
(=:) = test markdown
|
||||
|
||||
tests :: [Test]
|
||||
tests = [ testGroup "inline code"
|
||||
[ "with attribute" =:
|
||||
"`document.write(\"Hello\");`{.javascript}"
|
||||
=?> para
|
||||
(codeWith ("",["javascript"],[]) "document.write(\"Hello\");")
|
||||
, "with attribute space" =:
|
||||
"`*` {.haskell .special x=\"7\"}"
|
||||
=?> para (codeWith ("",["haskell","special"],[("x","7")]) "*")
|
||||
]
|
||||
]
|
|
@ -6,6 +6,7 @@ import Test.Framework
|
|||
|
||||
import qualified Tests.Old
|
||||
import qualified Tests.Readers.LaTeX
|
||||
import qualified Tests.Readers.Markdown
|
||||
import qualified Tests.Readers.RST
|
||||
import qualified Tests.Writers.ConTeXt
|
||||
import qualified Tests.Writers.Native
|
||||
|
@ -18,6 +19,7 @@ tests = [ testGroup "Old" Tests.Old.tests
|
|||
]
|
||||
, testGroup "Readers"
|
||||
[ testGroup "LaTeX" Tests.Readers.LaTeX.tests
|
||||
, testGroup "Markdown" Tests.Readers.Markdown.tests
|
||||
, testGroup "RST" Tests.Readers.RST.tests
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue