Add Org writer unit tests

This commit is contained in:
Alexander Krotov 2017-02-12 17:09:07 +03:00
parent 48c78713c8
commit 48f809384a
3 changed files with 28 additions and 0 deletions

View file

@ -530,6 +530,7 @@ Test-Suite test-pandoc
Tests.Writers.Docbook Tests.Writers.Docbook
Tests.Writers.HTML Tests.Writers.HTML
Tests.Writers.Markdown Tests.Writers.Markdown
Tests.Writers.Org
Tests.Writers.Plain Tests.Writers.Plain
Tests.Writers.AsciiDoc Tests.Writers.AsciiDoc
Tests.Writers.LaTeX Tests.Writers.LaTeX

25
test/Tests/Writers/Org.hs Normal file
View file

@ -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]]"
]
]

View file

@ -21,6 +21,7 @@ import qualified Tests.Writers.HTML
import qualified Tests.Writers.Docbook import qualified Tests.Writers.Docbook
import qualified Tests.Writers.Native import qualified Tests.Writers.Native
import qualified Tests.Writers.Markdown import qualified Tests.Writers.Markdown
import qualified Tests.Writers.Org
import qualified Tests.Writers.Plain import qualified Tests.Writers.Plain
import qualified Tests.Writers.AsciiDoc import qualified Tests.Writers.AsciiDoc
import qualified Tests.Writers.Docx import qualified Tests.Writers.Docx
@ -41,6 +42,7 @@ tests = [ Tests.Command.tests
, testGroup "HTML" Tests.Writers.HTML.tests , testGroup "HTML" Tests.Writers.HTML.tests
, testGroup "Docbook" Tests.Writers.Docbook.tests , testGroup "Docbook" Tests.Writers.Docbook.tests
, testGroup "Markdown" Tests.Writers.Markdown.tests , testGroup "Markdown" Tests.Writers.Markdown.tests
, testGroup "Org" Tests.Writers.Org.tests
, testGroup "Plain" Tests.Writers.Plain.tests , testGroup "Plain" Tests.Writers.Plain.tests
, testGroup "AsciiDoc" Tests.Writers.AsciiDoc.tests , testGroup "AsciiDoc" Tests.Writers.AsciiDoc.tests
, testGroup "Docx" Tests.Writers.Docx.tests , testGroup "Docx" Tests.Writers.Docx.tests