From b8218b80705b69c43e875dbe99ddb9ce6b20ff65 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Mon, 27 Jan 2020 14:39:28 +0300 Subject: [PATCH] Add basic test outline for the SILE Writer --- test/Tests/Writers/SILE.hs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/Tests/Writers/SILE.hs diff --git a/test/Tests/Writers/SILE.hs b/test/Tests/Writers/SILE.hs new file mode 100644 index 0000000000000..e85f7b291ac62 --- /dev/null +++ b/test/Tests/Writers/SILE.hs @@ -0,0 +1,37 @@ +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} +module Tests.Writers.SILE (tests) where + +import Prelude +import Data.Text (unpack) +import Test.Tasty +import Tests.Helpers +import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder + +sile :: (ToPandoc a) => a -> String +sile = sileWithOpts def + +sileWithOpts :: (ToPandoc a) => WriterOptions -> a -> String +sileWithOpts opts = unpack . purely (writeSILE opts) . toPandoc + +{- + "my test" =: X =?> Y + +is shorthand for + + test sile "my test" $ X =?> Y + +which is in turn shorthand for + + test sile "my test" (X,Y) +-} + +infix 4 =: +(=:) :: (ToString a, ToPandoc a) + => String -> (a, String) -> TestTree +(=:) = test sile + +tests :: [TestTree] +tests = []