From d99776ea0405143d1b95f740a68b2a67cb0e73dd Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sat, 28 Oct 2017 18:13:51 +0300 Subject: Add new style FB2 tests --- test/Tests/Writers/FB2.hs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/Tests/Writers/FB2.hs (limited to 'test/Tests') diff --git a/test/Tests/Writers/FB2.hs b/test/Tests/Writers/FB2.hs new file mode 100644 index 000000000..77ab4a82c --- /dev/null +++ b/test/Tests/Writers/FB2.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE OverloadedStrings #-} +module Tests.Writers.FB2 (tests) where + +import Test.Tasty +import Tests.Helpers +import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder + +fb2 :: String -> String +fb2 x = "\n" ++ + "pandoc<p />

" ++ x ++ "
" + +infix 4 =: +(=:) :: (ToString a, ToPandoc a) + => String -> (a, String) -> TestTree +(=:) = test (purely (writeFB2 def) . toPandoc) + +tests :: [TestTree] +tests = [ testGroup "block elements" + ["para" =: para "Lorem ipsum cetera." + =?> fb2 "

Lorem ipsum cetera.

" + ] + , testGroup "inlines" + [ + "Emphasis" =: emph ("emphasized") + =?> fb2 "emphasized" + ] + , "bullet list" =: bulletList [ plain $ text "first" + , plain $ text "second" + , plain $ text "third" + ] + =?> fb2 "

\x2022 first

\x2022 second

\x2022 third

" + ] -- cgit v1.2.3