summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-02-12 17:09:07 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-02-12 17:09:07 +0300
commit48f809384ab94912234b95087cef6b30b26935b1 (patch)
treed833ef6579ab336fe899293ecf6547c849968987 /test
parent48c78713c8faf445bed23ae3005abdba3273346b (diff)
Add Org writer unit tests
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Writers/Org.hs25
-rw-r--r--test/test-pandoc.hs2
2 files changed, 27 insertions, 0 deletions
diff --git a/test/Tests/Writers/Org.hs b/test/Tests/Writers/Org.hs
new file mode 100644
index 000000000..e2c58327b
--- /dev/null
+++ b/test/Tests/Writers/Org.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Tests.Writers.Org (tests) where
+
+import Test.Framework
+import Text.Pandoc.Builder
+import Text.Pandoc
+import Tests.Helpers
+import Text.Pandoc.Arbitrary()
+
+infix 4 =:
+(=:) :: (ToString a, ToPandoc a)
+ => String -> (a, String) -> Test
+(=:) = test (purely (writeOrg def . toPandoc))
+
+tests :: [Test]
+tests = [ testGroup "links"
+ -- See http://orgmode.org/manual/Internal-links.html#Internal-links
+ [ "simple link"
+ =: link "/url" "" "foo"
+ =?> "[[/url][foo]]"
+ , "internal link to anchor"
+ =: link "#my-custom-id" "" "#my-custom-id"
+ =?> "[[#my-custom-id]]"
+ ]
+ ]
diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs
index 2624e9a53..8800dde24 100644
--- a/test/test-pandoc.hs
+++ b/test/test-pandoc.hs
@@ -21,6 +21,7 @@ import qualified Tests.Writers.HTML
import qualified Tests.Writers.Docbook
import qualified Tests.Writers.Native
import qualified Tests.Writers.Markdown
+import qualified Tests.Writers.Org
import qualified Tests.Writers.Plain
import qualified Tests.Writers.AsciiDoc
import qualified Tests.Writers.Docx
@@ -41,6 +42,7 @@ tests = [ Tests.Command.tests
, testGroup "HTML" Tests.Writers.HTML.tests
, testGroup "Docbook" Tests.Writers.Docbook.tests
, testGroup "Markdown" Tests.Writers.Markdown.tests
+ , testGroup "Org" Tests.Writers.Org.tests
, testGroup "Plain" Tests.Writers.Plain.tests
, testGroup "AsciiDoc" Tests.Writers.AsciiDoc.tests
, testGroup "Docx" Tests.Writers.Docx.tests