summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-06-23 10:39:07 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-06-23 10:43:09 +0100
commit666b27c79a3d36d0d16899de3bdc2e1e74d0fde6 (patch)
treef0804578dc73e7b2984d63903fe4cc0b974d3317
parent633bbc1fd4762a2bb73ba1c5b9e0c279f1dd3c40 (diff)
downloadhaskell-wip/t18330.tar.gz
ghci: Add test for #18330wip/t18330
This test was fixed by 25977ab542a30df4ae71d9699d015bcdd1ab7cfb Fixes #18330
-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.T3
5 files changed, 22 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..605bd0d507 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -320,6 +320,9 @@ 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'])
+ , 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'])