summaryrefslogtreecommitdiff
path: root/src/testdir/test_expand.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_expand.vim')
-rw-r--r--src/testdir/test_expand.vim18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/testdir/test_expand.vim b/src/testdir/test_expand.vim
index 5a5190371..d86fea4f4 100644
--- a/src/testdir/test_expand.vim
+++ b/src/testdir/test_expand.vim
@@ -81,7 +81,11 @@ func Test_expandcmd()
call assert_fails('call expandcmd("make <afile>")', 'E495:')
enew
call assert_fails('call expandcmd("make %")', 'E499:')
- close
+ let $FOO="blue\tsky"
+ call setline(1, "$FOO")
+ call assert_equal("grep pat blue\tsky", expandcmd('grep pat <cfile>'))
+ unlet $FOO
+ close!
endfunc
" Test for expanding <sfile>, <slnum> and <sflnum> outside of sourcing a script
@@ -108,5 +112,17 @@ func Test_source_sfile()
call delete('Xresult')
endfunc
+" Test for expanding filenames multiple times in a command line
+func Test_expand_filename_multicmd()
+ edit foo
+ call setline(1, 'foo!')
+ new
+ call setline(1, 'foo!')
+ new <cword> | new <cWORD>
+ call assert_equal(4, winnr('$'))
+ call assert_equal('foo!', bufname(winbufnr(1)))
+ call assert_equal('foo', bufname(winbufnr(2)))
+ %bwipe!
+endfunc
" vim: shiftwidth=2 sts=2 expandtab