aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers/Ms.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Tests/Writers/Ms.hs')
-rw-r--r--test/Tests/Writers/Ms.hs37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/Tests/Writers/Ms.hs b/test/Tests/Writers/Ms.hs
new file mode 100644
index 000000000..d73603314
--- /dev/null
+++ b/test/Tests/Writers/Ms.hs
@@ -0,0 +1,37 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE OverloadedStrings #-}
+module Tests.Writers.Ms (tests) where
+
+import Prelude
+import Test.Tasty
+import Tests.Helpers
+import Text.Pandoc
+import Text.Pandoc.Builder
+
+infix 4 =:
+(=:) :: (ToString a, ToPandoc a)
+ => String -> (a, String) -> TestTree
+(=:) = test (purely (writeMs def . toPandoc))
+
+tests :: [TestTree]
+tests = [ testGroup "code blocks"
+ [ "basic"
+ =: codeBlock "hello"
+ =?> unlines
+ [ ".IP"
+ , ".nf"
+ , "\\f[C]"
+ , "hello"
+ , "\\f[]"
+ , ".fi"]
+ , "escape starting ."
+ =: codeBlock ". hello"
+ =?> unlines
+ [ ".IP"
+ , ".nf"
+ , "\\f[C]"
+ , "\\&. hello"
+ , "\\f[]"
+ , ".fi"]
+ ]
+ ]