summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-06-23 10:39:07 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-25 05:19:53 -0400
commit30afb381f380149eb98f80d96c9bfb082c9fac0e (patch)
tree1f773b5aa56f6abc5c8e005e099448701e2d9b49 /testsuite
parentd1f59540e8b7be96b55ab4b286539a70bc75416c (diff)
downloadhaskell-30afb381f380149eb98f80d96c9bfb082c9fac0e.tar.gz
ghci: Add test for #18330
This test was fixed by 25977ab542a30df4ae71d9699d015bcdd1ab7cfb Fixes #18330
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci/scripts/T18330.extra1
-rw-r--r--testsuite/tests/ghci/scripts/T18330.hs5
-rw-r--r--testsuite/tests/ghci/scripts/T18330.script5
-rw-r--r--testsuite/tests/ghci/scripts/T18330.stdout8
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T4
5 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T18330.extra b/testsuite/tests/ghci/scripts/T18330.extra
new file mode 100644
index 0000000000..257cc5642c
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T18330.extra
@@ -0,0 +1 @@
+foo
diff --git a/testsuite/tests/ghci/scripts/T18330.hs b/testsuite/tests/ghci/scripts/T18330.hs
new file mode 100644
index 0000000000..a1cf17e9ed
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T18330.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TemplateHaskell #-}
+module T18330 where
+import Language.Haskell.TH.Syntax
+
+$(addDependentFile "T18330.extra" >> return [])
diff --git a/testsuite/tests/ghci/scripts/T18330.script b/testsuite/tests/ghci/scripts/T18330.script
new file mode 100644
index 0000000000..fbb0ca082b
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T18330.script
@@ -0,0 +1,5 @@
+:l shell.hs
+:def shell (\s -> do shell s; return "")
+:l T18330.hs
+:shell echo "new line" > T18330.extra
+:r
diff --git a/testsuite/tests/ghci/scripts/T18330.stdout b/testsuite/tests/ghci/scripts/T18330.stdout
new file mode 100644
index 0000000000..c020ae7dbb
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T18330.stdout
@@ -0,0 +1,8 @@
+GHCi, version 9.3.20210616: https://www.haskell.org/ghc/ :? for help
+ghci> [1 of 1] Compiling Main ( shell.hs, interpreted )
+Ok, one module loaded.
+ghci> ghci> [1 of 1] Compiling T18330 ( T18330.hs, interpreted )
+Ok, one module loaded.
+ghci> ghci> [1 of 1] Compiling T18330 ( T18330.hs, interpreted ) [T18330.extra changed]
+Ok, one module loaded.
+ghci> Leaving GHCi.
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index a265881501..ec137685ef 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -320,6 +320,10 @@ test('T17500', [extra_run_opts('-ddump-to-file -ddump-bcos')], ghci_script, ['T1
test('T17549', normal, ghci_script, ['T17549.script'])
test('T17669', [extra_run_opts('-fexternal-interpreter -fobject-code'),
unless(opsys('mingw32'), expect_broken(17669))], ghci_script, ['T17669.script'])
+test('T18330', [copy_files, extra_files(['../shell.hs', 'T18330.extra', 'T18330.hs'])
+ , filter_stdout_lines(r'ghci>.*')
+ , extra_hc_opts('-v1')]
+ , ghci_script, ['T18330.script'])
test('T18501', normal, ghci_script, ['T18501.script'])
test('T18644', normal, ghci_script, ['T18644.script'])
test('T18755', normal, ghci_script, ['T18755.script'])