2013-01-23 08:47:43 -08:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
2011-06-22 19:46:54 -07:00
|
|
|
module Tests.Writers.Markdown (tests) where
|
|
|
|
|
|
|
|
import Test.Framework
|
|
|
|
import Text.Pandoc.Builder
|
|
|
|
import Text.Pandoc
|
|
|
|
import Tests.Helpers
|
|
|
|
import Tests.Arbitrary()
|
|
|
|
|
|
|
|
markdown :: (ToString a, ToPandoc a) => a -> String
|
2012-07-26 22:59:56 -07:00
|
|
|
markdown = writeMarkdown def . toPandoc
|
2011-06-22 19:46:54 -07:00
|
|
|
|
|
|
|
{-
|
|
|
|
"my test" =: X =?> Y
|
|
|
|
|
|
|
|
is shorthand for
|
|
|
|
|
|
|
|
test markdown "my test" $ X =?> Y
|
|
|
|
|
|
|
|
which is in turn shorthand for
|
|
|
|
|
|
|
|
test markdown "my test" (X,Y)
|
|
|
|
-}
|
|
|
|
|
2012-02-05 13:23:06 -08:00
|
|
|
infix 4 =:
|
2011-06-22 19:46:54 -07:00
|
|
|
(=:) :: (ToString a, ToPandoc a)
|
|
|
|
=> String -> (a, String) -> Test
|
|
|
|
(=:) = test markdown
|
|
|
|
|
|
|
|
tests :: [Test]
|
|
|
|
tests = [ "indented code after list"
|
2011-12-13 14:29:07 -08:00
|
|
|
=: (orderedList [ para "one" <> para "two" ] <> codeBlock "test")
|
2011-06-22 19:46:54 -07:00
|
|
|
=?> "1. one\n\n two\n\n<!-- -->\n\n test"
|
|
|
|
]
|