blob: 08cc9b63b92df5cd7cc3b7c8a25b00585da1ca95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
{-# LANGUAGE TypeSynonymInstances #-}
-- Utility functions for the test suite.
module Tests.Helpers where
import Text.Pandoc
import Text.Pandoc.Builder
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test)
-- in Helpers
class Expect a where
(=?>) :: Pandoc -> a -> Assertion
infix 8 =?>
(=:) :: TestName -> Assertion -> Test
(=:) = testCase
infix 6 =:
instance Expect Inlines where
(Pandoc _ [Para ils]) =?> e = assertEqual " " (toList e) ils
g =?> e = assertEqual " " (doc $ para e) g
instance Expect Blocks where
(Pandoc _ bls) =?> e = assertEqual " " (toList e) bls
instance Expect Pandoc where
g =?> e = assertEqual " " e g
|