2016-05-18 19:01:56 -07:00
|
|
|
" Test that the system menu can be loaded.
|
|
|
|
|
2019-01-26 06:38:43 -07:00
|
|
|
if !has('menu')
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2016-05-18 19:01:56 -07:00
|
|
|
func Test_load_menu()
|
|
|
|
try
|
|
|
|
source $VIMRUNTIME/menu.vim
|
|
|
|
catch
|
2017-06-05 20:41:46 -07:00
|
|
|
call assert_report('error while loading menus: ' . v:exception)
|
2016-05-18 19:01:56 -07:00
|
|
|
endtry
|
2018-03-24 20:06:07 -07:00
|
|
|
call assert_match('browse confirm w', execute(':menu File.Save'))
|
2021-04-10 15:29:08 -07:00
|
|
|
|
|
|
|
let v:errmsg = ''
|
|
|
|
doautocmd LoadBufferMenu VimEnter
|
|
|
|
call assert_equal('', v:errmsg)
|
|
|
|
|
2019-01-26 06:38:43 -07:00
|
|
|
source $VIMRUNTIME/delmenu.vim
|
2021-04-10 15:29:08 -07:00
|
|
|
call assert_equal('', v:errmsg)
|
2019-01-26 06:38:43 -07:00
|
|
|
endfunc
|
|
|
|
|
|
|
|
func Test_translate_menu()
|
|
|
|
if !has('multi_lang')
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
if !filereadable($VIMRUNTIME . '/lang/menu_de_de.latin1.vim')
|
|
|
|
throw 'Skipped: translated menu not found'
|
|
|
|
endif
|
|
|
|
|
2018-03-24 20:06:07 -07:00
|
|
|
" First delete any English menus.
|
|
|
|
source $VIMRUNTIME/delmenu.vim
|
2019-01-26 06:38:43 -07:00
|
|
|
set langmenu=de_de
|
|
|
|
source $VIMRUNTIME/menu.vim
|
2019-01-26 06:44:16 -07:00
|
|
|
call assert_match('browse confirm w', execute(':menu Datei.Speichern'))
|
2019-01-26 06:38:43 -07:00
|
|
|
|
|
|
|
source $VIMRUNTIME/delmenu.vim
|
2016-05-18 19:01:56 -07:00
|
|
|
endfunc
|