Add tests for new TH #4124, #4128, #4170, #4364, #6062
authorKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Sat, 5 Oct 2013 17:08:09 +0000 (19:08 +0200)
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Sat, 5 Oct 2013 17:10:18 +0000 (19:10 +0200)
testsuite/tests/th/T4124.hs [new file with mode: 0644]
testsuite/tests/th/T4128.hs [new file with mode: 0644]
testsuite/tests/th/T4170.hs [new file with mode: 0644]
testsuite/tests/th/T4364.hs [new file with mode: 0644]
testsuite/tests/th/T6062.hs [new file with mode: 0644]
testsuite/tests/th/all.T

diff --git a/testsuite/tests/th/T4124.hs b/testsuite/tests/th/T4124.hs
new file mode 100644 (file)
index 0000000..a3dddda
--- /dev/null
@@ -0,0 +1,6 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T4124 where
+
+class Storable a where
+data X = X
+[d| instance Storable $( [t| X |] ) where |]
diff --git a/testsuite/tests/th/T4128.hs b/testsuite/tests/th/T4128.hs
new file mode 100644 (file)
index 0000000..961ba4c
--- /dev/null
@@ -0,0 +1,7 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T4128 where
+
+import Language.Haskell.TH
+class C a where
+data X = X
+fmap return $ instanceD (cxt []) [t| C $(conT ''X) |] []
diff --git a/testsuite/tests/th/T4170.hs b/testsuite/tests/th/T4170.hs
new file mode 100644 (file)
index 0000000..87ccad6
--- /dev/null
@@ -0,0 +1,13 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T4170 where
+
+import Language.Haskell.TH
+
+class LOL a
+
+lol :: Q [Dec]
+lol = [d|
+    instance LOL Int
+    |]
+
+instance LOL Int
diff --git a/testsuite/tests/th/T4364.hs b/testsuite/tests/th/T4364.hs
new file mode 100644 (file)
index 0000000..1278c2a
--- /dev/null
@@ -0,0 +1,7 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T4364 where
+
+data Z
+
+type N0 = $( [t| Z |] )
+type N1 = $( [t| Z |] )
diff --git a/testsuite/tests/th/T6062.hs b/testsuite/tests/th/T6062.hs
new file mode 100644 (file)
index 0000000..330b3f2
--- /dev/null
@@ -0,0 +1,3 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T6062 where
+x = [| False True |]
index 9b9b730..5c0315f 100644 (file)
@@ -293,3 +293,10 @@ test('T8333',
      normal,
      run_command,
      ['$MAKE -s --no-print-directory T8333'])
+
+test('T4170', normal, compile, ['-v0'])
+test('T4124', normal, compile, ['-v0'])
+test('T4128', normal, compile, ['-v0'])
+test('T6062', normal, compile, ['-v0'])
+test('T4364', normal, compile, ['-v0'])
+