2018-03-18 18:46:28 +01:00
|
|
|
{-# LANGUAGE NoImplicitPrelude #-}
|
2017-02-12 15:09:07 +01:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
module Tests.Writers.Org (tests) where
|
|
|
|
|
2018-03-18 18:46:28 +01:00
|
|
|
import Prelude
|
2017-03-14 17:05:36 +01:00
|
|
|
import Test.Tasty
|
2017-02-12 15:09:07 +01:00
|
|
|
import Tests.Helpers
|
2017-03-04 13:03:41 +01:00
|
|
|
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)
|
2017-03-14 17:05:36 +01:00
|
|
|
=> String -> (a, String) -> TestTree
|
2017-02-12 15:09:07 +01:00
|
|
|
(=:) = test (purely (writeOrg def . toPandoc))
|
|
|
|
|
2017-03-14 17:05:36 +01:00
|
|
|
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]]"
|
|
|
|
]
|
|
|
|
]
|