summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_diffmode.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-09 19:21:30 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-09 19:21:30 +0100
commit1ef73e33c9414eb02c229d8234aafd9d481a8856 (patch)
treeea8c934b8f2e1d109ab7bce70074bf0bde5dda09 /src/testdir/test_diffmode.vim
parentad2cfb54b78523435b31de7234081ff70a53e736 (diff)
patch 8.0.0442: patch shell command not well escapedv8.0.0442
Problem: Patch shell command uses double quotes around the argument, which allows for $HOME to be expanded. (Etienne) Solution: Use single quotes on Unix. (closes #1543)
Diffstat (limited to 'src/testdir/test_diffmode.vim')
-rw-r--r--src/testdir/test_diffmode.vim17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 73f944bcea..c23e8a1da5 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -318,9 +318,20 @@ func Test_diffpatch()
bwipe!
new
call assert_fails('diffpatch Xpatch', 'E816:')
- call setline(1, ['1', '2', '3'])
- diffpatch Xpatch
- call assert_equal(['1', '2x', '3', '4'], getline(1, '$'))
+
+ for name in ['Xpatch', 'Xpatch$HOME']
+ call setline(1, ['1', '2', '3'])
+ if name != 'Xpatch'
+ call rename('Xpatch', name)
+ endif
+ exe 'diffpatch ' . escape(name, '$')
+ call assert_equal(['1', '2x', '3', '4'], getline(1, '$'))
+ if name != 'Xpatch'
+ call rename(name, 'Xpatch')
+ endif
+ bwipe!
+ endfor
+
call delete('Xpatch')
bwipe!
endfunc