@@ -1309,13 +1309,22 @@ func Test_cmdlineclear_tabenter()
13091309 call delete (' XtestCmdlineClearTabenter' )
13101310endfunc
13111311
1312- " Test for failure in expanding special keywords in cmdline
1312+ " Test for expanding special keywords in cmdline
13131313func Test_cmdline_expand_special ()
13141314 % bwipe!
13151315 call assert_fails (' e #' , ' E499:' )
13161316 call assert_fails (' e <afile>' , ' E495:' )
13171317 call assert_fails (' e <abuf>' , ' E496:' )
13181318 call assert_fails (' e <amatch>' , ' E497:' )
1319+
1320+ call writefile ([], ' Xfile.cpp' )
1321+ call writefile ([], ' Xfile.java' )
1322+ new Xfile.cpp
1323+ call feedkeys (" :e %:r\<C-A>\<C-B> \" \<CR> " , ' xt' )
1324+ call assert_equal (' "e Xfile.cpp Xfile.java' , @: )
1325+ close
1326+ call delete (' Xfile.cpp' )
1327+ call delete (' Xfile.java' )
13191328endfunc
13201329
13211330func Test_cmdwin_jump_to_win ()
@@ -1823,5 +1832,24 @@ func Test_cmd_map_cmdlineChanged()
18231832 augroup END
18241833endfunc
18251834
1835+ " Test for the 'suffixes' option
1836+ func Test_suffixes_opt ()
1837+ call writefile ([], ' Xfile' )
1838+ call writefile ([], ' Xfile.c' )
1839+ call writefile ([], ' Xfile.o' )
1840+ set suffixes =
1841+ call feedkeys (" :e Xfi*\<C-A>\<C-B> \" \<CR> " , ' xt' )
1842+ call assert_equal (' "e Xfile Xfile.c Xfile.o' , @: )
1843+ set suffixes = .c
1844+ call feedkeys (" :e Xfi*\<C-A>\<C-B> \" \<CR> " , ' xt' )
1845+ call assert_equal (' "e Xfile Xfile.o Xfile.c' , @: )
1846+ set suffixes = ,,
1847+ call feedkeys (" :e Xfi*\<C-A>\<C-B> \" \<CR> " , ' xt' )
1848+ call assert_equal (' "e Xfile.c Xfile.o Xfile' , @: )
1849+ set suffixes &
1850+ call delete (' Xfile' )
1851+ call delete (' Xfile.c' )
1852+ call delete (' Xfile.o' )
1853+ endfunc
18261854
18271855" vim: shiftwidth = 2 sts = 2 expandtab
0 commit comments