summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorOle Krüger <ole@vprsm.de>2021-01-28 18:09:57 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-22 18:27:06 -0500
commit58897e2423cd120fbb32eda87f63aa56540a033f (patch)
tree6d18405f3e0b293d6e087ba1a51a833a0ebcba4e /libraries
parent6d7086a3512f2e832d4e53154c574e62e034962b (diff)
downloadhaskell-58897e2423cd120fbb32eda87f63aa56540a033f.tar.gz
Add test case for CompleteP pretty-printer (#19270)
Diffstat (limited to 'libraries')
-rw-r--r--libraries/template-haskell/tests/all.T1
-rw-r--r--libraries/template-haskell/tests/pragCompletePpr.hs7
-rw-r--r--libraries/template-haskell/tests/pragCompletePpr.stdout1
3 files changed, 9 insertions, 0 deletions
diff --git a/libraries/template-haskell/tests/all.T b/libraries/template-haskell/tests/all.T
index 1d48d411d0..48f05c64fa 100644
--- a/libraries/template-haskell/tests/all.T
+++ b/libraries/template-haskell/tests/all.T
@@ -1,2 +1,3 @@
# difficult to test TH with profiling, because we have to build twice
test('dataToExpQUnit', [omit_ways(prof_ways), req_interp], compile, ['-v0'])
+test('pragCompletePpr', [omit_ways(prof_ways), req_interp], compile_and_run, [''])
diff --git a/libraries/template-haskell/tests/pragCompletePpr.hs b/libraries/template-haskell/tests/pragCompletePpr.hs
new file mode 100644
index 0000000000..cb06cdb10d
--- /dev/null
+++ b/libraries/template-haskell/tests/pragCompletePpr.hs
@@ -0,0 +1,7 @@
+module Main (main) where
+
+import Language.Haskell.TH.Ppr (ppr)
+import Language.Haskell.TH.Syntax (Dec (PragmaD), Pragma (CompleteP), mkName)
+
+main :: IO ()
+main = print $ ppr $ PragmaD $ CompleteP [mkName "Foo", mkName "Bar"] $ Just $ mkName "Bar"
diff --git a/libraries/template-haskell/tests/pragCompletePpr.stdout b/libraries/template-haskell/tests/pragCompletePpr.stdout
new file mode 100644
index 0000000000..289e2ac71c
--- /dev/null
+++ b/libraries/template-haskell/tests/pragCompletePpr.stdout
@@ -0,0 +1 @@
+{-# COMPLETE Foo, Bar :: Bar #-}