summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-10-13 16:12:57 +0100
committerIan Lynagh <ian@well-typed.com>2012-10-13 16:12:57 +0100
commitd4aca87911e1b7863700edee971960fec81fdaf2 (patch)
tree66d81a859034d93496e3648bd7c6d376010b98e7
parent6afab2274eb1d959cced87602b687955f0d10d13 (diff)
downloadhaskell-d4aca87911e1b7863700edee971960fec81fdaf2.tar.gz
Add a test for reloading a module in GHCi
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T5
-rw-r--r--testsuite/tests/ghci/scripts/ghci058.script14
-rw-r--r--testsuite/tests/ghci/scripts/ghci058.stdout4
3 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 52cf9e4808..880efa312f 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -131,3 +131,8 @@ test('T6091', normal, ghci_script, ['T6091.script'])
test('T6106', extra_clean(['T6106.hs']), ghci_script, ['T6106.script'])
test('T6105', normal, ghci_script, ['T6105.script'])
test('T7117', normal, ghci_script, ['T7117.script'])
+test('ghci058',
+ extra_clean(['Ghci058.hs', 'Ghci058.hi', 'Ghci058.o']),
+ ghci_script,
+ ['ghci058.script'])
+
diff --git a/testsuite/tests/ghci/scripts/ghci058.script b/testsuite/tests/ghci/scripts/ghci058.script
new file mode 100644
index 0000000000..99999894ee
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/ghci058.script
@@ -0,0 +1,14 @@
+
+:set prompt ""
+:set -v1
+
+:! echo "module Ghci058 where c = 'a'" > Ghci058.hs
+:! "$HC" $HC_OPTS -fforce-recomp -c Ghci058.hs
+:l Ghci058
+c
+
+:! echo "module Ghci058 where c = 'b'" > Ghci058.hs
+:! "$HC" $HC_OPTS -fforce-recomp -c Ghci058.hs
+:l Ghci058
+c
+
diff --git a/testsuite/tests/ghci/scripts/ghci058.stdout b/testsuite/tests/ghci/scripts/ghci058.stdout
new file mode 100644
index 0000000000..7347571096
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/ghci058.stdout
@@ -0,0 +1,4 @@
+Ok, modules loaded: Ghci058.
+'a'
+Ok, modules loaded: Ghci058.
+'b'