summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorFlaviu Andrei Csernik (archblob) <fcsernik@gmail.com>2015-06-01 02:13:36 -0500
committerAustin Seipp <austin@well-typed.com>2015-06-01 02:13:36 -0500
commit4756438962a76d2dcedf63b90ec789cb054f9556 (patch)
tree684cf8063cb78910c934f7729e59c34521853051 /testsuite
parent94fff17963af2292504d02ead819bc4340878786 (diff)
downloadhaskell-4756438962a76d2dcedf63b90ec789cb054f9556.tar.gz
Catch canonicalizePath exceptions, fix #10101
Summary: Introduce by #95 'canonicalizePath' throws and exception when given an invalid file in a call to 'sameFile'. There are two cases when this can happen when using ghci: 1) If there is an error at the interactive prompt, "<interactive>" file is searched for and not found. 2) If there is an error in any loaded file and editing an inexistent/new file with 'e: foo'. Both cases are now tested. Test Plan: validate Reviewers: austin, #ghc Reviewed By: austin, #ghc Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D930 GHC Trac Issues: #10101
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci/prog013/prog013.script4
-rw-r--r--testsuite/tests/ghci/prog013/prog013.stderr14
-rw-r--r--testsuite/tests/ghci/prog013/prog013.stdout2
3 files changed, 17 insertions, 3 deletions
diff --git a/testsuite/tests/ghci/prog013/prog013.script b/testsuite/tests/ghci/prog013/prog013.script
index d4b91deec1..f2e234384b 100644
--- a/testsuite/tests/ghci/prog013/prog013.script
+++ b/testsuite/tests/ghci/prog013/prog013.script
@@ -6,3 +6,7 @@
:e ./Bad.hs
:l Good.hs
:e
++
+:e foo
+:l Bad.hs
+:e bar
diff --git a/testsuite/tests/ghci/prog013/prog013.stderr b/testsuite/tests/ghci/prog013/prog013.stderr
index d8970d4d2e..ce8827f6ca 100644
--- a/testsuite/tests/ghci/prog013/prog013.stderr
+++ b/testsuite/tests/ghci/prog013/prog013.stderr
@@ -1,9 +1,17 @@
-Bad.hs:3:8:
+Bad.hs:3:8: error:
lexical error in string/character literal at character '\n'
-Bad.hs:3:8:
+Bad.hs:3:8: error:
lexical error in string/character literal at character '\n'
-Bad.hs:3:8:
+Bad.hs:3:8: error:
+ lexical error in string/character literal at character '\n'
+
+<interactive>:10:1: error: parse error on input ‘+’
+
+Bad.hs:3:8: error:
+ lexical error in string/character literal at character '\n'
+
+Bad.hs:3:8: error:
lexical error in string/character literal at character '\n'
diff --git a/testsuite/tests/ghci/prog013/prog013.stdout b/testsuite/tests/ghci/prog013/prog013.stdout
index 0d621dad77..024fd7905a 100644
--- a/testsuite/tests/ghci/prog013/prog013.stdout
+++ b/testsuite/tests/ghci/prog013/prog013.stdout
@@ -2,3 +2,5 @@ Good.hs
Bad.hs +3
./Bad.hs +3
Good.hs
+foo
+bar