aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-26 09:09:32 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-26 17:23:56 -0800
commitc5384a33c0488d7e1274ba5579a24cf733eee934 (patch)
tree5526bf2ad746db20296242fa73227992b667da95
parent422bba202ef6731f0487880f08200f5dc9d6bbb0 (diff)
downloadpandoc-c5384a33c0488d7e1274ba5579a24cf733eee934.tar.gz
Updates for compiling with ghc 7.
We now use a CPP trick to have compatible quasiquotes that work in both GHC 6.12 and 7.
-rw-r--r--pandoc.cabal10
-rw-r--r--tests/Tests/Helpers.hs8
-rw-r--r--tests/Tests/Writers/ConTeXt.hs2
3 files changed, 13 insertions, 7 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index f57ca1bb2..c441a9439 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -330,7 +330,11 @@ Executable test-pandoc
Hs-Source-Dirs: tests, src
Main-Is: test-pandoc.hs
if flag(highlighting)
- cpp-options: -D_HIGHLIGHTING
+ cpp-options: -D_HIGHLIGHTING
+ if impl(ghc >= 7)
+ cpp-options: -D_LIT=lit
+ else
+ cpp-options: -D_LIT=$lit
if !flag(tests)
Buildable: False
else
@@ -342,9 +346,9 @@ Executable test-pandoc
Build-Depends: base >= 4 && < 5, Diff, test-framework >= 0.3 && < 0.4,
test-framework-hunit >= 0.2 && < 0.3,
test-framework-quickcheck2 >= 0.2.9 && < 0.3,
- QuickCheck == 2.4.*,
+ QuickCheck >= 2.4 && < 2.6,
HUnit >= 1.2 && < 1.3,
- template-haskell == 2.4.*,
+ template-haskell >= 2.4 && < 2.6,
ansi-terminal == 0.5.*
Other-Modules: Tests.Old
Tests.Helpers
diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs
index 53bad097e..b8d6b83a7 100644
--- a/tests/Tests/Helpers.hs
+++ b/tests/Tests/Helpers.hs
@@ -20,15 +20,17 @@ import Test.HUnit (assertBool)
import Text.Pandoc.Shared (normalize, defaultWriterOptions,
WriterOptions(..), removeTrailingSpace)
import Text.Pandoc.Writers.Native (writeNative)
-import Language.Haskell.TH.Quote
+import Language.Haskell.TH.Quote (QuasiQuoter(..))
import Language.Haskell.TH.Syntax (Q, runIO)
import qualified Test.QuickCheck.Property as QP
import System.Console.ANSI
import Data.Algorithm.Diff
lit :: QuasiQuoter
-lit = QuasiQuoter ((\a -> let b = rnl a in [|b|]) . filter (/= '\r')) $
- error "Cannot use lit as a pattern"
+lit = QuasiQuoter {
+ quoteExp = (\a -> let b = rnl a in [|b|]) . filter (/= '\r')
+ , quotePat = error "Cannot use lit as a pattern"
+ }
where rnl ('\n':xs) = xs
rnl xs = xs
diff --git a/tests/Tests/Writers/ConTeXt.hs b/tests/Tests/Writers/ConTeXt.hs
index db01e1560..ab8efee3d 100644
--- a/tests/Tests/Writers/ConTeXt.hs
+++ b/tests/Tests/Writers/ConTeXt.hs
@@ -52,7 +52,7 @@ tests = [ testGroup "inline code"
bulletList [plain (text "top")
,bulletList [plain (text "next")
,bulletList [plain (text "bot")]]]
- =?> [$lit|
+ =?> [_LIT|
\startitemize
\item
top