diff options
author | James McCoy <jamessan@jamessan.com> | 2016-03-28 09:47:46 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-03-30 08:30:35 -0400 |
commit | 7558f42f7d9900d37a1915ce78f1102ee251d420 (patch) | |
tree | 42b54298c1c2638a8c8c80d18a7a6c5210f8d9b7 /test | |
parent | 62c0d99474eb0dffcd36d227057755c16c8a9570 (diff) | |
download | rneovim-7558f42f7d9900d37a1915ce78f1102ee251d420.tar.gz rneovim-7558f42f7d9900d37a1915ce78f1102ee251d420.tar.bz2 rneovim-7558f42f7d9900d37a1915ce78f1102ee251d420.zip |
vim-patch:7.4.1654
Problem: Crash when using expand('%:S') in a buffer without a name.
Solution: Don't set a NUL. (James McCoy, closes vim/vim#714)
https://github.com/vim/vim/commit/52c6eaffd43a8c8865f8d6ed7cde0a8b137479e2
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/fnamemodify_spec.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index a439e91b6f..2a32aea127 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -54,6 +54,12 @@ describe('filename modifiers', function() set shell=tcsh call assert_equal("'abc\\\ndef'", fnamemodify("abc\ndef", ':S')) endfunc + + func Test_expand() + new + call assert_equal("", expand('%:S')) + quit + endfunc ]=]) end) @@ -61,4 +67,9 @@ describe('filename modifiers', function() call('Test_fnamemodify') expected_empty() end) + + it('works for :S in an unnamed buffer', function() + call('Test_expand') + expected_empty() + end) end) |