From 910937985a4237a170d4c704c22f6ba222130c9e Mon Sep 17 00:00:00 2001 From: Evan Rutledge Borden Date: Tue, 28 Nov 2017 18:46:57 -0500 Subject: [PATCH] Add failing test for template haskell splices For some reason `brittany` is failing to print exact for top level splices. This may be an issue in `brittany` or `ghc-exact-print`, I'm not sure. I've added failing tests to highlight this issue. This bug causes `brittany` to produce syntactically invalid Haskell. ``` 1) template haskell top level splice expected: Right {-# LANGUAGE TemplateHaskell #-} deriveFromJSON (unPrefix "assignPost") ''AssignmentPost but got: Right {-# LANGUAGE TemplateHaskell #-} deriveFromJSON (unPrefix "assignPost") '' ``` --- src-literatetests/tests.blt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src-literatetests/tests.blt b/src-literatetests/tests.blt index e54841b..b87a418 100644 --- a/src-literatetests/tests.blt +++ b/src-literatetests/tests.blt @@ -590,6 +590,23 @@ func = ++ [ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc] +############################################################################### +############################################################################### +############################################################################### +#group template haskell +############################################################################### +############################################################################### +############################################################################### + +#test top level splice +{-# LANGUAGE TemplateHaskell #-} +deriveFromJSON (unPrefix "assignPost") ''AssignmentPost + +#test top level splice wrapped +{-# LANGUAGE TemplateHaskell #-} +$(deriveFromJSON (unPrefix "assignPost") ''AssignmentPost) + + ############################################################################### ############################################################################### ############################################################################### @@ -1057,7 +1074,7 @@ foo = ## from the input; i cannot really express this yet with the current ## test-suite. ## #test ayaz -## +## ## myManageHook = ## composeOne [isFullscreen -?> doFullFloat, isDialog -?> doFloat, transience] ## <+> composeAll