aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/expand_spec.lua
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-25 17:22:19 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-25 20:36:01 -0400
commit08aa9b00237ab45dadeffdf381e0e3c228337e53 (patch)
tree957ca9030f1b97b48e8befb38e1bbe185b0251ad /test/functional/legacy/expand_spec.lua
parent55419a6904306c21e6537a3b891df761ac352540 (diff)
downloadrneovim-08aa9b00237ab45dadeffdf381e0e3c228337e53.tar.gz
rneovim-08aa9b00237ab45dadeffdf381e0e3c228337e53.tar.bz2
rneovim-08aa9b00237ab45dadeffdf381e0e3c228337e53.zip
vim-patch:8.1.0211: expanding a file name "~" results in $HOME
Problem: Expanding a file name "~" results in $HOME. (Aidan Shafran) Solution: Change "~" to "./~" before expanding. (closes vim/vim#3072) https://github.com/vim/vim/commit/00136dc321586800986e8f743c2f108f5eecbf92
Diffstat (limited to 'test/functional/legacy/expand_spec.lua')
-rw-r--r--test/functional/legacy/expand_spec.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/legacy/expand_spec.lua b/test/functional/legacy/expand_spec.lua
index 7bf6fb67dc..1b735080f4 100644
--- a/test/functional/legacy/expand_spec.lua
+++ b/test/functional/legacy/expand_spec.lua
@@ -62,6 +62,14 @@ describe('expand file name', function()
call delete('Xdir ~ dir', 'd')
call assert_false(isdirectory('Xdir ~ dir'))
endfunc
+
+ func Test_expand_tilde_filename()
+ split ~
+ call assert_equal('~', expand('%'))
+ call assert_notequal(expand('%:p'), expand('~/'))
+ call assert_match('\~', expand('%:p'))
+ bwipe!
+ endfunc
]])
end)
@@ -74,4 +82,9 @@ describe('expand file name', function()
call('Test_with_tilde')
expected_empty()
end)
+
+ it('does not expand tilde if it is a filename', function()
+ call('Test_expand_tilde_filename')
+ expected_empty()
+ end)
end)