diff options
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r-- | src/testdir/test_cmdline.vim | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index bba7e725e9..d167d4c7c5 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -1309,13 +1309,22 @@ func Test_cmdlineclear_tabenter() call delete('XtestCmdlineClearTabenter') endfunc -" Test for failure in expanding special keywords in cmdline +" Test for expanding special keywords in cmdline func Test_cmdline_expand_special() %bwipe! call assert_fails('e #', 'E499:') call assert_fails('e <afile>', 'E495:') call assert_fails('e <abuf>', 'E496:') call assert_fails('e <amatch>', 'E497:') + + call writefile([], 'Xfile.cpp') + call writefile([], 'Xfile.java') + new Xfile.cpp + call feedkeys(":e %:r\<C-A>\<C-B>\"\<CR>", 'xt') + call assert_equal('"e Xfile.cpp Xfile.java', @:) + close + call delete('Xfile.cpp') + call delete('Xfile.java') endfunc func Test_cmdwin_jump_to_win() @@ -1823,5 +1832,24 @@ func Test_cmd_map_cmdlineChanged() augroup END endfunc +" Test for the 'suffixes' option +func Test_suffixes_opt() + call writefile([], 'Xfile') + call writefile([], 'Xfile.c') + call writefile([], 'Xfile.o') + set suffixes= + call feedkeys(":e Xfi*\<C-A>\<C-B>\"\<CR>", 'xt') + call assert_equal('"e Xfile Xfile.c Xfile.o', @:) + set suffixes=.c + call feedkeys(":e Xfi*\<C-A>\<C-B>\"\<CR>", 'xt') + call assert_equal('"e Xfile Xfile.o Xfile.c', @:) + set suffixes=,, + call feedkeys(":e Xfi*\<C-A>\<C-B>\"\<CR>", 'xt') + call assert_equal('"e Xfile.c Xfile.o Xfile', @:) + set suffixes& + call delete('Xfile') + call delete('Xfile.c') + call delete('Xfile.o') +endfunc " vim: shiftwidth=2 sts=2 expandtab |