aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers/Markua.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests/Writers/Markua.hs')
-rw-r--r--test/Tests/Writers/Markua.hs40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/Tests/Writers/Markua.hs b/test/Tests/Writers/Markua.hs
new file mode 100644
index 000000000..62239f3da
--- /dev/null
+++ b/test/Tests/Writers/Markua.hs
@@ -0,0 +1,40 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Tests.Writers.Markua (tests) where
+
+import Test.Tasty
+import Tests.Helpers
+import Text.Pandoc
+import Text.Pandoc.Arbitrary ()
+import Text.Pandoc.Builder
+
+{-
+ "my test" =: X =?> Y
+
+is shorthand for
+
+ test html "my test" $ X =?> Y
+
+which is in turn shorthand for
+
+ test html "my test" (X,Y)
+-}
+
+infix 4 =:
+(=:) :: (ToString a, ToPandoc a)
+ => String -> (a, String) -> TestTree
+(=:) = test (purely (writeMarkua def) . toPandoc)
+
+tests :: [TestTree]
+tests = [ testGroup "simple blurb/aside"
+ ["blurb" =: divWith ("",["blurb"],[]) (bulletList [para "blurb content"])
+ =?> "B> * blurb content"
+ ,"aside" =: divWith ("",["aside"],[]) (bulletList [para "aside list"])
+ =?> "A> * aside list"
+ ]
+ ,testGroup "multiclass blurb/aside"
+ ["blurb" =: divWith ("",["blurb", "otherclass"],[]) (bulletList [para "blurb content"])
+ =?> "B> * blurb content"
+ ,"aside" =: divWith ("",["otherclass", "aside"],[]) (bulletList [para "aside list"])
+ =?> "A> * aside list"
+ ]
+ ]