@@ -1,9 +1,7 @@
1−{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, TemplateHaskell #-}
1+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
2-- Utility functions for the test suite.
2-- Utility functions for the test suite.
4−module Tests.Helpers ( lit
4+module Tests.Helpers ( test
9 , ToString(..)
7 , ToString(..)
@@ -20,34 +18,9 @@ import Test.HUnit (assertBool)
20import Text.Pandoc.Shared (normalize, trimr)
18import Text.Pandoc.Shared (normalize, trimr)
21import Text.Pandoc.Options
19import Text.Pandoc.Options
22import Text.Pandoc.Writers.Native (writeNative)
20import Text.Pandoc.Writers.Native (writeNative)
23−import Language.Haskell.TH.Quote (QuasiQuoter(..))
24−import Language.Haskell.TH.Syntax (Q, runIO)
25import qualified Test.QuickCheck.Property as QP
21import qualified Test.QuickCheck.Property as QP
26import Data.Algorithm.Diff
22import Data.Algorithm.Diff
30− quoteExp = (\a -> let b = rnl a in [|b|]) . filter (/= '\r')
31− , quotePat = error "Unimplemented"
32− , quoteType = error "Unimplemented"
33− , quoteDec = error "Unimplemented"
35− where rnl ('\n':xs) = xs
41−-- adapted from TH 2.5 code
42−quoteFile :: QuasiQuoter -> QuasiQuoter
43−quoteFile (QuasiQuoter { quoteExp = qe, quotePat = qp }) =
44− QuasiQuoter { quoteExp = get qe, quotePat = get qp,
45− quoteType = error "Unimplemented", quoteDec = error "Unimplemented" }
47− get :: (String -> Q a) -> String -> Q a
48− get old_quoter file_name = do { file_cts <- runIO (readFile file_name)
49− ; old_quoter file_cts }
51test :: (ToString a, ToString b, ToString c)
24test :: (ToString a, ToString b, ToString c)
52 => (a -> b) -- ^ function to test
25 => (a -> b) -- ^ function to test
53 -> String -- ^ name of test case
26 -> String -- ^ name of test case