pandoc/test/Tests/Writers/Org.hs

28 lines
756 B
Haskell
Raw Normal View History

{-# LANGUAGE NoImplicitPrelude #-}
2017-02-12 15:09:07 +01:00
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.Org (tests) where
import Prelude
import Test.Tasty
2017-02-12 15:09:07 +01:00
import Tests.Helpers
import Text.Pandoc
import Text.Pandoc.Arbitrary ()
import Text.Pandoc.Builder
2017-02-12 15:09:07 +01:00
infix 4 =:
(=:) :: (ToString a, ToPandoc a)
=> String -> (a, String) -> TestTree
2017-02-12 15:09:07 +01:00
(=:) = test (purely (writeOrg def . toPandoc))
tests :: [TestTree]
2017-02-12 15:09:07 +01:00
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]]"
]
]