git.iko.soy/typeable/pandoc
on master help sign in
Add Org writer unit tests
commit48f809384ab94912234b95087cef6b30b26935b1 authorAlexander Krotov <ilabdsf@gmail.com> dateSun 12 Feb 2017, 17:09 (10 years ago) parent48c7871
3 files changed+28
pandoc.cabal+1 test/Tests/Writers/Org.hs+25 test/test-pandoc.hs+2
pandoc.cabal+1
@@ -530,6 +530,7 @@ Test-Suite test-pandoc
530530 Tests.Writers.Docbook
531531 Tests.Writers.HTML
532532 Tests.Writers.Markdown
533+ Tests.Writers.Org
533534 Tests.Writers.Plain
534535 Tests.Writers.AsciiDoc
535536 Tests.Writers.LaTeX
test/Tests/Writers/Org.hsnew file+25
@@ -0,0 +1,25 @@
1+{-# LANGUAGE OverloadedStrings #-}
2+module Tests.Writers.Org (tests) where
3+
4+import Test.Framework
5+import Text.Pandoc.Builder
6+import Text.Pandoc
7+import Tests.Helpers
8+import Text.Pandoc.Arbitrary()
9+
10+infix 4 =:
11+(=:) :: (ToString a, ToPandoc a)
12+ => String -> (a, String) -> Test
13+(=:) = test (purely (writeOrg def . toPandoc))
14+
15+tests :: [Test]
16+tests = [ testGroup "links"
17+ -- See http://orgmode.org/manual/Internal-links.html#Internal-links
18+ [ "simple link"
19+ =: link "/url" "" "foo"
20+ =?> "[[/url][foo]]"
21+ , "internal link to anchor"
22+ =: link "#my-custom-id" "" "#my-custom-id"
23+ =?> "[[#my-custom-id]]"
24+ ]
25+ ]
test/test-pandoc.hs+2
@@ -21,6 +21,7 @@ import qualified Tests.Writers.HTML
2121import qualified Tests.Writers.Docbook
2222import qualified Tests.Writers.Native
2323import qualified Tests.Writers.Markdown
24+import qualified Tests.Writers.Org
2425import qualified Tests.Writers.Plain
2526import qualified Tests.Writers.AsciiDoc
2627import qualified Tests.Writers.Docx
@@ -41,6 +42,7 @@ tests = [ Tests.Command.tests
4142 , testGroup "HTML" Tests.Writers.HTML.tests
4243 , testGroup "Docbook" Tests.Writers.Docbook.tests
4344 , testGroup "Markdown" Tests.Writers.Markdown.tests
45+ , testGroup "Org" Tests.Writers.Org.tests
4446 , testGroup "Plain" Tests.Writers.Plain.tests
4547 , testGroup "AsciiDoc" Tests.Writers.AsciiDoc.tests
4648 , testGroup "Docx" Tests.Writers.Docx.tests