Skip to content

Commit b8218b8

Browse files
committed
Add basic test outline for the SILE Writer
1 parent 51ebc85 commit b8218b8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/Tests/Writers/SILE.hs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{-# LANGUAGE NoImplicitPrelude #-}
2+
{-# LANGUAGE OverloadedStrings #-}
3+
module Tests.Writers.SILE (tests) where
4+
5+
import Prelude
6+
import Data.Text (unpack)
7+
import Test.Tasty
8+
import Tests.Helpers
9+
import Text.Pandoc
10+
import Text.Pandoc.Arbitrary ()
11+
import Text.Pandoc.Builder
12+
13+
sile :: (ToPandoc a) => a -> String
14+
sile = sileWithOpts def
15+
16+
sileWithOpts :: (ToPandoc a) => WriterOptions -> a -> String
17+
sileWithOpts opts = unpack . purely (writeSILE opts) . toPandoc
18+
19+
{-
20+
"my test" =: X =?> Y
21+
22+
is shorthand for
23+
24+
test sile "my test" $ X =?> Y
25+
26+
which is in turn shorthand for
27+
28+
test sile "my test" (X,Y)
29+
-}
30+
31+
infix 4 =:
32+
(=:) :: (ToString a, ToPandoc a)
33+
=> String -> (a, String) -> TestTree
34+
(=:) = test sile
35+
36+
tests :: [TestTree]
37+
tests = []

0 commit comments

Comments
 (0)