diff options
author | Zejun Wu <watashi@fb.com> | 2018-12-17 23:35:44 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-12-17 23:36:53 -0500 |
commit | a0fb20bae31ed7a50d1a6e4e15c42ba25d836bfc (patch) | |
tree | 8a2bee666e0e2c443afed18808802f1429b833b1 /testsuite | |
parent | ed69f8bd1fd4b84b62bb4f10eef7f76e537be07b (diff) | |
download | haskell-a0fb20bae31ed7a50d1a6e4e15c42ba25d836bfc.tar.gz |
Fix ghci crash when starting with -fno-implicit-import-qualified
`ghci -fno-implicit-import-qualified` didn't start with error message:
```
GHCi, version 8.6.2: http://www.haskell.org/ghc/ :? for help
<interactive>:1:6: error:
Not in scope: ‘System.IO.hSetBuffering’
No module named ‘System.IO’ is imported.
...
```
This change fixes it and update test T2452 to cover this.
Test Plan:
TEST=T2452 make accept
harbormaster build runs
Reviewers: simonmar, bgamari, RyanGlScott
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5452
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/ghci/scripts/T2452.script | 3 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T2452.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T2452.stdout | 2 | ||||
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 3 |
4 files changed, 11 insertions, 1 deletions
diff --git a/testsuite/tests/ghci/scripts/T2452.script b/testsuite/tests/ghci/scripts/T2452.script index 28d2bdc580..ef60f82e7a 100644 --- a/testsuite/tests/ghci/scripts/T2452.script +++ b/testsuite/tests/ghci/scripts/T2452.script @@ -1,2 +1,5 @@ +:t System.IO.hPutStrLn +:set -fimplicit-import-qualified +:t System.IO.hPutStrLn :set -fno-implicit-import-qualified :t System.IO.hPutStrLn diff --git a/testsuite/tests/ghci/scripts/T2452.stderr b/testsuite/tests/ghci/scripts/T2452.stderr index 663742f67c..99b0acbd21 100644 --- a/testsuite/tests/ghci/scripts/T2452.stderr +++ b/testsuite/tests/ghci/scripts/T2452.stderr @@ -2,3 +2,7 @@ <interactive>:1:1: error: Not in scope: ‘System.IO.hPutStrLn’ No module named ‘System.IO’ is imported. + +<interactive>:1:1: error: + Not in scope: ‘System.IO.hPutStrLn’ + No module named ‘System.IO’ is imported. diff --git a/testsuite/tests/ghci/scripts/T2452.stdout b/testsuite/tests/ghci/scripts/T2452.stdout new file mode 100644 index 0000000000..b2dc3f68b2 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T2452.stdout @@ -0,0 +1,2 @@ +System.IO.hPutStrLn + :: GHC.IO.Handle.Types.Handle -> String -> IO () diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index c58f5872cf..13753cd3ec 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -108,7 +108,8 @@ test('ghci062', [extra_files(['ghci062/', 'ghci062/Test.hs']), ghci_script, ['ghci062.script']) test('ghci063', normal, ghci_script, ['ghci063.script']) -test('T2452', normal, ghci_script, ['T2452.script']) +test('T2452', [extra_hc_opts("-fno-implicit-import-qualified")], + ghci_script, ['T2452.script']) test('T2766', normal, ghci_script, ['T2766.script']) test('T1914', [], ghci_script, ['T1914.script']) |