summaryrefslogtreecommitdiff
path: root/testsuite/tests/monadfail
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2016-11-08 21:37:48 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2016-12-07 21:31:13 +0200
commit499e43824bda967546ebf95ee33ec1f84a114a7c (patch)
tree58b313d734cfba014395ea5876db48e8400296a8 /testsuite/tests/monadfail
parent83d69dca896c7df1f2a36268d5b45c9283985ebf (diff)
downloadhaskell-499e43824bda967546ebf95ee33ec1f84a114a7c.tar.gz
Add HsSyn prettyprinter tests
Summary: Add prettyprinter tests, which take a file, parse it, pretty print it, re-parse the pretty printed version and then compare the original and new ASTs (ignoring locations) Updates haddock submodule to match the AST changes. There are three issues outstanding 1. Extra parens around a context are not reproduced. This will require an AST change and will be done in a separate patch. 2. Currently if an `HsTickPragma` is found, this is not pretty-printed, to prevent noise in the output. I am not sure what the desired behaviour in this case is, so have left it as before. Test Ppr047 is marked as expected fail for this. 3. Apart from in a context, the ParsedSource AST keeps all the parens from the original source. Something is happening in the renamer to remove the parens around visible type application, causing T12530 to fail, as the dumped splice decl is after the renamer. This needs to be fixed by keeping the parens, but I do not know where they are being removed. I have amended the test to pass, by removing the parens in the expected output. Test Plan: ./validate Reviewers: goldfire, mpickering, simonpj, bgamari, austin Reviewed By: simonpj, bgamari Subscribers: simonpj, goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2752 GHC Trac Issues: #3384
Diffstat (limited to 'testsuite/tests/monadfail')
-rw-r--r--testsuite/tests/monadfail/MonadFailErrors.stderr32
-rw-r--r--testsuite/tests/monadfail/MonadFailWarnings.stderr32
2 files changed, 32 insertions, 32 deletions
diff --git a/testsuite/tests/monadfail/MonadFailErrors.stderr b/testsuite/tests/monadfail/MonadFailErrors.stderr
index 84334b980b..1507984d14 100644
--- a/testsuite/tests/monadfail/MonadFailErrors.stderr
+++ b/testsuite/tests/monadfail/MonadFailErrors.stderr
@@ -13,12 +13,12 @@ MonadFailErrors.hs:16:5: error:
general :: Monad m => m a
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘general’:
general
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined
MonadFailErrors.hs:30:5: error:
• No instance for (MonadFail Identity)
@@ -26,12 +26,12 @@ MonadFailErrors.hs:30:5: error:
with the failable pattern ‘Just x’
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘identity’:
identity
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined
MonadFailErrors.hs:44:5: error:
• No instance for (MonadFail (ST s))
@@ -39,12 +39,12 @@ MonadFailErrors.hs:44:5: error:
with the failable pattern ‘Just x’
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘st’:
st
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined
MonadFailErrors.hs:51:5: error:
• No instance for (MonadFail ((->) r))
@@ -52,9 +52,9 @@ MonadFailErrors.hs:51:5: error:
with the failable pattern ‘Just x’
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘reader’:
reader
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined
diff --git a/testsuite/tests/monadfail/MonadFailWarnings.stderr b/testsuite/tests/monadfail/MonadFailWarnings.stderr
index 544f14aeb4..ac16d6cd9e 100644
--- a/testsuite/tests/monadfail/MonadFailWarnings.stderr
+++ b/testsuite/tests/monadfail/MonadFailWarnings.stderr
@@ -13,12 +13,12 @@ MonadFailWarnings.hs:19:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)
general :: Monad m => m a
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘general’:
general
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined
MonadFailWarnings.hs:35:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)]
• No instance for (MonadFail Identity)
@@ -26,12 +26,12 @@ MonadFailWarnings.hs:35:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)
(this will become an error in a future GHC release)
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘identity’:
identity
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined
MonadFailWarnings.hs:51:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)]
• No instance for (MonadFail (ST s))
@@ -39,12 +39,12 @@ MonadFailWarnings.hs:51:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)
(this will become an error in a future GHC release)
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘st’:
st
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined
MonadFailWarnings.hs:59:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)]
• No instance for (MonadFail ((->) r))
@@ -52,9 +52,9 @@ MonadFailWarnings.hs:59:5: warning: [-Wmissing-monadfail-instances (in -Wcompat)
(this will become an error in a future GHC release)
• In a stmt of a 'do' block: Just x <- undefined
In the expression:
- do { Just x <- undefined;
- undefined }
+ do Just x <- undefined
+ undefined
In an equation for ‘reader’:
reader
- = do { Just x <- undefined;
- undefined }
+ = do Just x <- undefined
+ undefined