summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-12-11 13:48:08 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-11 18:04:30 -0500
commit18b74cdbbfa053704caabd104587d8a91a9233a0 (patch)
tree9caa58f154956b1d267cf5421befa17007a0885a /testsuite
parentf582379de2c4ff7577235c926ad953debdae3cac (diff)
downloadhaskell-18b74cdbbfa053704caabd104587d8a91a9233a0.tar.gz
testsuite: Add tests for #15270
Reviewers: alpmestan Reviewed By: alpmestan Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5216
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/th/T15270A.hs8
-rw-r--r--testsuite/tests/th/T15270A.stderr5
-rw-r--r--testsuite/tests/th/T15270B.hs8
-rw-r--r--testsuite/tests/th/T15270B.stderr5
-rw-r--r--testsuite/tests/th/all.T2
5 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/th/T15270A.hs b/testsuite/tests/th/T15270A.hs
new file mode 100644
index 0000000000..d317f8f7c3
--- /dev/null
+++ b/testsuite/tests/th/T15270A.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T10047A where
+
+import Language.Haskell.TH
+
+-- Passing var name to conE should fail.
+x = $(conE 'id)
diff --git a/testsuite/tests/th/T15270A.stderr b/testsuite/tests/th/T15270A.stderr
new file mode 100644
index 0000000000..2eb67f60ba
--- /dev/null
+++ b/testsuite/tests/th/T15270A.stderr
@@ -0,0 +1,5 @@
+
+T15270A.hs:8:7:
+ Illegal data constructor name: ‘id’
+ When splicing a TH expression: GHC.Base.id
+ In the untyped splice: $(conE 'id)
diff --git a/testsuite/tests/th/T15270B.hs b/testsuite/tests/th/T15270B.hs
new file mode 100644
index 0000000000..397b5dc131
--- /dev/null
+++ b/testsuite/tests/th/T15270B.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module T10047B where
+
+import Language.Haskell.TH
+
+-- Passing datacon name to varE should fail.
+x = $(varE 'Just)
diff --git a/testsuite/tests/th/T15270B.stderr b/testsuite/tests/th/T15270B.stderr
new file mode 100644
index 0000000000..3403d13e2b
--- /dev/null
+++ b/testsuite/tests/th/T15270B.stderr
@@ -0,0 +1,5 @@
+
+T15270B.hs:8:7:
+ Illegal variable name: ‘Just’
+ When splicing a TH expression: GHC.Maybe.Just
+ In the untyped splice: $(varE 'Just)
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index e404c8ff82..0ab7dba20f 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -419,6 +419,8 @@ test('T14885a', normal, compile, [''])
test('T14885b', normal, compile, [''])
test('T14885c', normal, compile, [''])
test('T15243', normal, compile, ['-dsuppress-uniques'])
+test('T15270A', normal, compile_fail, [''])
+test('T15270B', normal, compile_fail, [''])
test('T15321', normal, compile_fail, [''])
test('T15324', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
test('T15331', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])