[commit: testsuite] master: test for #7231 (7326c95)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7326c95b12c414084b69328429a38ac666876a21

>---------------------------------------------------------------

commit 7326c95b12c414084b69328429a38ac666876a21
Author: Simon Marlow <[email protected]>
Date:   Tue Nov 27 08:54:38 2012 +0000

    test for #7231

>---------------------------------------------------------------

 tests/ghci/prog012/Bar1.hs                         |    1 +
 tests/ghci/prog012/Bar2.hs                         |    3 +++
 tests/ghci/prog012/Foo.hs                          |    3 +++
 tests/ghci/prog012/Main.hs                         |    4 ++++
 .../should_compile => ghci/prog012}/Makefile       |    0 
 tests/ghci/prog012/all.T                           |    2 ++
 tests/ghci/prog012/prog012.script                  |   18 ++++++++++++++++++
 tests/ghci/prog012/prog012.stderr                  |    2 ++
 .../prog012/prog012.stdout}                        |    0 
 9 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/tests/ghci/prog012/Bar1.hs b/tests/ghci/prog012/Bar1.hs
new file mode 100644
index 0000000..9d63afd
--- /dev/null
+++ b/tests/ghci/prog012/Bar1.hs
@@ -0,0 +1 @@
+module Bar where
diff --git a/tests/ghci/prog012/Bar2.hs b/tests/ghci/prog012/Bar2.hs
new file mode 100644
index 0000000..755b8e8
--- /dev/null
+++ b/tests/ghci/prog012/Bar2.hs
@@ -0,0 +1,3 @@
+module Bar where
+
+bar = nonexistent
diff --git a/tests/ghci/prog012/Foo.hs b/tests/ghci/prog012/Foo.hs
new file mode 100644
index 0000000..03884ff
--- /dev/null
+++ b/tests/ghci/prog012/Foo.hs
@@ -0,0 +1,3 @@
+module Foo where
+
+foo = "foo"
diff --git a/tests/ghci/prog012/Main.hs b/tests/ghci/prog012/Main.hs
new file mode 100644
index 0000000..d49d063
--- /dev/null
+++ b/tests/ghci/prog012/Main.hs
@@ -0,0 +1,4 @@
+module Main where
+
+import Foo
+import Bar
diff --git a/tests/annotations/should_compile/Makefile b/tests/ghci/prog012/Makefile
similarity index 100%
copy from tests/annotations/should_compile/Makefile
copy to tests/ghci/prog012/Makefile
diff --git a/tests/ghci/prog012/all.T b/tests/ghci/prog012/all.T
new file mode 100644
index 0000000..c4aa9ca
--- /dev/null
+++ b/tests/ghci/prog012/all.T
@@ -0,0 +1,2 @@
+test('prog012', extra_clean(['Bar.hs']), ghci_script, ['prog012.script'])
+
diff --git a/tests/ghci/prog012/prog012.script b/tests/ghci/prog012/prog012.script
new file mode 100644
index 0000000..49af938
--- /dev/null
+++ b/tests/ghci/prog012/prog012.script
@@ -0,0 +1,18 @@
+:l ../shell.hs
+:def shell (\s -> do shell s; return "")
+:l
+
+-- example from #7231, modified: the example in the ticket did not
+-- trigger the bug, because a module containing only '"' will fail
+-- in the downsweep, which is before we unload modules.  Hence this
+-- repro case uses a module that contains an unbound identifier and
+-- fails in the renamer.
+
+:shell cp Bar1.hs Bar.hs
+
+:load Main.hs
+:shell sleep 1
+:shell cp Bar2.hs Bar.hs
+
+:reload
+foo
diff --git a/tests/ghci/prog012/prog012.stderr b/tests/ghci/prog012/prog012.stderr
new file mode 100644
index 0000000..71f2bbe
--- /dev/null
+++ b/tests/ghci/prog012/prog012.stderr
@@ -0,0 +1,2 @@
+
+Bar.hs:3:7: Not in scope: `nonexistent'
diff --git a/tests/typecheck/should_run/tcrun026.stdout b/tests/ghci/prog012/prog012.stdout
similarity index 100%
copy from tests/typecheck/should_run/tcrun026.stdout
copy to tests/ghci/prog012/prog012.stdout
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.