Add testcase for #5984
authorPaolo Capriotti <p.capriotti@gmail.com>
Mon, 2 Apr 2012 14:55:33 +0000 (15:55 +0100)
committerPaolo Capriotti <p.capriotti@gmail.com>
Mon, 2 Apr 2012 14:55:33 +0000 (15:55 +0100)
testsuite/tests/th/T5984.hs [new file with mode: 0644]
testsuite/tests/th/T5984.stderr [new file with mode: 0644]
testsuite/tests/th/T5984_Lib.hs [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T5984.hs b/testsuite/tests/th/T5984.hs
new file mode 100644 (file)
index 0000000..63f21b6
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T5984 where
+
+import T5984_Lib
+
+$nt
+$dt
diff --git a/testsuite/tests/th/T5984.stderr b/testsuite/tests/th/T5984.stderr
new file mode 100644 (file)
index 0000000..50c7cbf
--- /dev/null
@@ -0,0 +1,10 @@
+T5984.hs:1:1: Splicing declarations
+    nt
+  ======>
+    T5984.hs:7:1-3
+    newtype Foo = Foo Int
+T5984.hs:1:1: Splicing declarations
+    dt
+  ======>
+    T5984.hs:8:1-3
+    data Bar = Bar Int
diff --git a/testsuite/tests/th/T5984_Lib.hs b/testsuite/tests/th/T5984_Lib.hs
new file mode 100644 (file)
index 0000000..c3abfa2
--- /dev/null
@@ -0,0 +1,13 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T5984_Lib where
+
+import Language.Haskell.TH
+
+nt :: Q [Dec]
+nt = return [NewtypeD [] foo [] (NormalC foo [(NotStrict, ConT ''Int)]) []]
+  where foo = mkName "Foo"
+
+dt :: Q [Dec]
+dt = return [DataD [] bar [] [NormalC bar [(NotStrict, ConT ''Int)]] []]
+  where bar = mkName "Bar"
index 4bf6a32..89b599b 100644 (file)
@@ -228,4 +228,5 @@ test('T5886', extra_clean(['T5886a.hi','T5886a.o']),
 test('T4135', normal, compile, ['-v0'])
 test('T5971', normal, compile_fail, ['-v0 -dsuppress-uniques'])
 test('T5968', normal, compile, ['-v0'])
-
+test('T5984', extra_clean(['T5984_Lib.hi', 'T5984_Lib.o']),
+              multimod_compile, ['T5984', '-v0 -ddump-splices'])