summaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert+github@zeitkraut.de>2017-02-12 16:50:36 +0100
committerGitHub <noreply@github.com>2017-02-12 16:50:36 +0100
commit64ad6ff8d9aed32198763411f8bf6019aac21805 (patch)
tree595f81b2a3ca1fb18dc67c4c5dde201ae71c17e7 /test/Tests
parent48c78713c8faf445bed23ae3005abdba3273346b (diff)
parent9e3f5a5147c2cbc7d230c6fe7d8eaf8244b70c24 (diff)
Merge pull request #3438 from ilabdsf/org-anchor-links
Org anchor links
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Writers/Org.hs25
1 files changed, 25 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]]"
+ ]
+ ]