Added Tests.Readers.Markdown.

This commit is contained in:
John MacFarlane 2011-01-26 22:09:09 -08:00
parent f8dca6ccbc
commit 0acf774011
3 changed files with 32 additions and 0 deletions

View file

@ -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

View 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")]) "*")
]
]

View file

@ -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
]
]