summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2015-11-20 07:26:42 -0600
committerAustin Seipp <austin@well-typed.com>2015-11-20 07:27:05 -0600
commita689c8edb1639669cb8df58092b8b77a0a581717 (patch)
tree6b39f3fc3645e21ef5e40d96a38f76d2d9d033f0 /testsuite/tests
parentb72ca3e3fa54b80a2c376e259cd09df60c7106bf (diff)
downloadhaskell-a689c8edb1639669cb8df58092b8b77a0a581717.tar.gz
ghci: don't let ctags/etags overwrite source files
A ource file which was accidently passed as parameter into `:ctags` or `:etags` can be overwritten by tag data. This patch updates documentation to avoid confusion in commands usage and prevents `collateAndWriteTags` from modifying existing source files. Reviewed By: thomie, bgamari, austin Differential Revision: https://phabricator.haskell.org/D1471 GHC Trac Issues: #10989
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/ghci/scripts/T10989.script15
-rw-r--r--testsuite/tests/ghci/scripts/T10989.stderr6
-rw-r--r--testsuite/tests/ghci/scripts/T10989.stdout2
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T5
4 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T10989.script b/testsuite/tests/ghci/scripts/T10989.script
new file mode 100644
index 0000000000..d109e4eeda
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T10989.script
@@ -0,0 +1,15 @@
+writeFile "dummy.hs" "t = putStrLn \"Test\""
+writeFile "dummy.lhs" "> t = putStrLn \"Test\""
+:ctags dummy.hs
+:ctags dummy.lhs
+:ctags! dummy.hs
+:ctags! dummy.lhs
+:etags dummy.hs
+:etags dummy.lhs
+:ctags dummy.tags
+:ctags! dummy.tags
+:etags dummy.tags
+:l dummy.hs
+t
+:l dummy.lhs
+t
diff --git a/testsuite/tests/ghci/scripts/T10989.stderr b/testsuite/tests/ghci/scripts/T10989.stderr
new file mode 100644
index 0000000000..97b0d90ccf
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T10989.stderr
@@ -0,0 +1,6 @@
+dummy.hs is existing source file. Please specify another file name to store tags data
+dummy.lhs is existing source file. Please specify another file name to store tags data
+dummy.hs is existing source file. Please specify another file name to store tags data
+dummy.lhs is existing source file. Please specify another file name to store tags data
+dummy.hs is existing source file. Please specify another file name to store tags data
+dummy.lhs is existing source file. Please specify another file name to store tags data
diff --git a/testsuite/tests/ghci/scripts/T10989.stdout b/testsuite/tests/ghci/scripts/T10989.stdout
new file mode 100644
index 0000000000..95306f6347
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T10989.stdout
@@ -0,0 +1,2 @@
+Test
+Test
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 283251cf1f..1a664d128d 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -221,3 +221,8 @@ test('T10466', normal, ghci_script, ['T10466.script'])
test('T10501', normal, ghci_script, ['T10501.script'])
test('T10508', normal, ghci_script, ['T10508.script'])
test('T10520', normal, ghci_script, ['T10520.script'])
+test('T10989',
+ [
+ extra_clean(['dummy.hs', 'dummy.lhs', 'dummy.tags'])
+ ],
+ ghci_script, ['T10989.script'])