From 48f809384ab94912234b95087cef6b30b26935b1 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 12 Feb 2017 17:09:07 +0300 Subject: Add Org writer unit tests --- test/Tests/Writers/Org.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/Tests/Writers/Org.hs (limited to 'test/Tests') 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]]" + ] + ] -- cgit v1.2.3