summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2022-04-10 18:35:43 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-10-17 19:20:40 -0400
commitd80ad2f40f2092f14402351a6a3cb944039a57df (patch)
treef551d41cfea2c1b8c2b4b34d78b2e3c66c528c54 /testsuite/tests
parent8c72411d9504963069fb1ae736a2470cb9ae1250 (diff)
downloadhaskell-d80ad2f40f2092f14402351a6a3cb944039a57df.tar.gz
Update the check-exact infrastructure to match ghc-exactprint
GHC tests the exact print annotations using the contents of utils/check-exact. The same functionality is provided via https://github.com/alanz/ghc-exactprint The latter was updated to ensure it works with all of the files on hackage when 9.2 was released, as well as updated to ensure users of the library could work properly (apply-refact, retrie, etc). This commit brings the changes from ghc-exactprint into GHC/utils/check-exact, adapting for the changes to master. Once it lands, it will form the basis for the 9.4 version of ghc-exactprint. See also discussion around this process at #21355
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/ghc-api/exactprint/AddDecl2.expected.hs4
-rw-r--r--testsuite/tests/ghc-api/exactprint/RmDecl7.expected.hs2
-rw-r--r--testsuite/tests/ghc-api/exactprint/RmDecl7.hs1
-rw-r--r--testsuite/tests/printer/Makefile5
-rw-r--r--testsuite/tests/printer/Test21355.hs11
-rw-r--r--testsuite/tests/printer/all.T1
6 files changed, 20 insertions, 4 deletions
diff --git a/testsuite/tests/ghc-api/exactprint/AddDecl2.expected.hs b/testsuite/tests/ghc-api/exactprint/AddDecl2.expected.hs
index 5e134b5234..2bbbcf5b37 100644
--- a/testsuite/tests/ghc-api/exactprint/AddDecl2.expected.hs
+++ b/testsuite/tests/ghc-api/exactprint/AddDecl2.expected.hs
@@ -8,6 +8,6 @@ foo a b = a + b
-- | Do bar
bar x y = {- baz -} foo (x+y) x
--- end of file
-
nn = n2
+
+-- end of file
diff --git a/testsuite/tests/ghc-api/exactprint/RmDecl7.expected.hs b/testsuite/tests/ghc-api/exactprint/RmDecl7.expected.hs
index 9d7b8b9a69..aff106e9bc 100644
--- a/testsuite/tests/ghc-api/exactprint/RmDecl7.expected.hs
+++ b/testsuite/tests/ghc-api/exactprint/RmDecl7.expected.hs
@@ -3,5 +3,5 @@ module RmDecl7 where
toplevel :: Integer -> Integer
toplevel x = c * x
+-- c,d :: Integer
d = 9
-
diff --git a/testsuite/tests/ghc-api/exactprint/RmDecl7.hs b/testsuite/tests/ghc-api/exactprint/RmDecl7.hs
index 62cefe2154..c6c09e1be1 100644
--- a/testsuite/tests/ghc-api/exactprint/RmDecl7.hs
+++ b/testsuite/tests/ghc-api/exactprint/RmDecl7.hs
@@ -6,4 +6,3 @@ toplevel x = c * x
-- c,d :: Integer
c = 7
d = 9
-
diff --git a/testsuite/tests/printer/Makefile b/testsuite/tests/printer/Makefile
index 47640fa971..ca29268693 100644
--- a/testsuite/tests/printer/Makefile
+++ b/testsuite/tests/printer/Makefile
@@ -760,6 +760,11 @@ Test20256:
$(CHECK_PPR) $(LIBDIR) Test20256.hs
$(CHECK_EXACT) $(LIBDIR) Test20256.hs
+.PHONY: Test21355
+Test21355:
+ $(CHECK_PPR) $(LIBDIR) Test21355.hs
+ $(CHECK_EXACT) $(LIBDIR) Test21355.hs
+
.PHONY: Test21805
Test21805:
$(CHECK_PPR) $(LIBDIR) Test21805.hs
diff --git a/testsuite/tests/printer/Test21355.hs b/testsuite/tests/printer/Test21355.hs
new file mode 100644
index 0000000000..b8929604b2
--- /dev/null
+++ b/testsuite/tests/printer/Test21355.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE TemplateHaskell #-}
+module Test21355 where
+
+emptyBK = [d| {} |]
+
+data GitHubSignedReqBody''
+ (proxy :: KProxy k)
+ (key :: k)
+ (list :: [Type])
+ (result :: Type) where
diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T
index 3026099884..29e64f096a 100644
--- a/testsuite/tests/printer/all.T
+++ b/testsuite/tests/printer/all.T
@@ -179,4 +179,5 @@ test('Test20258', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20258'])
test('Test20297', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20297'])
test('Test20315', normal, compile_fail, [''])
test('Test20846', [ignore_stderr, req_ppr_deps], makefile_test, ['Test20846'])
+test('Test21355', [ignore_stderr, req_ppr_deps], makefile_test, ['Test21355'])
test('Test21805', [ignore_stderr, req_ppr_deps], makefile_test, ['Test21805'])