robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
b2828af5b5
master
1" Test for all command modifiers in 2 3let s: luaeval_cmdmods =<< trim END 4vim.iter(loadfile('../../../src/nvim/ex_cmds.lua')()):map(function(cmd) 5if cmd.func == 'ex_wrongmodifier' or cmd.command == 'hide' then 6return cmd.command 7else 8return nil 9end 10end):totable() 11END 12let s: cmdmods = [] 13 14func s: get_cmdmods () 15if empty ( s: cmdmods ) 16let s: cmdmods = luaeval ( s: luaeval_cmdmods ->join ( "\n" )) 17endif 18return s: cmdmods 19endfunc 20 21func Test_keep_cmdmods_names () 22call assert_equal ( 'k' , fullcommand ( ':k' )) 23call assert_equal ( 'k' , fullcommand ( ':ke' )) 24call assert_equal ( 'keepmarks' , fullcommand ( ':kee' )) 25call assert_equal ( 'keepmarks' , fullcommand ( ':keep' )) 26call assert_equal ( 'keepmarks' , fullcommand ( ':keepm' )) 27call assert_equal ( 'keepmarks' , fullcommand ( ':keepma' )) 28call assert_equal ( 'keepmarks' , fullcommand ( ':keepmar' )) 29call assert_equal ( 'keepmarks' , fullcommand ( ':keepmark' )) 30call assert_equal ( 'keepmarks' , fullcommand ( ':keepmarks' )) 31call assert_equal ( 'keepalt' , fullcommand ( ':keepa' )) 32call assert_equal ( 'keepalt' , fullcommand ( ':keepal' )) 33call assert_equal ( 'keepalt' , fullcommand ( ':keepalt' )) 34call assert_equal ( 'keepjumps' , fullcommand ( ':keepj' )) 35call assert_equal ( 'keepjumps' , fullcommand ( ':keepju' )) 36call assert_equal ( 'keepjumps' , fullcommand ( ':keepjum' )) 37call assert_equal ( 'keepjumps' , fullcommand ( ':keepjump' )) 38call assert_equal ( 'keepjumps' , fullcommand ( ':keepjumps' )) 39call assert_equal ( 'keeppatterns' , fullcommand ( ':keepp' )) 40call assert_equal ( 'keeppatterns' , fullcommand ( ':keeppa' )) 41call assert_equal ( 'keeppatterns' , fullcommand ( ':keeppat' )) 42call assert_equal ( 'keeppatterns' , fullcommand ( ':keeppatt' )) 43call assert_equal ( 'keeppatterns' , fullcommand ( ':keeppatte' )) 44call assert_equal ( 'keeppatterns' , fullcommand ( ':keeppatter' )) 45call assert_equal ( 'keeppatterns' , fullcommand ( ':keeppattern' )) 46call assert_equal ( 'keeppatterns' , fullcommand ( ':keeppatterns' )) 47endfunc 48 49func Test_cmdmod_completion () 50for mod in s: get_cmdmods () 51let cmd = $ '{mod} ed' 52if mod == 'filter' 53let cmd = $ '{mod} /pattern/ ed' 54endif 55call assert_equal ( 'edit' , getcompletion ( cmd , 'cmdline' )[ 0 ]) 56endfor 57endfunc 58 59" vim: shiftwidth=2 sts=2 expandtab