xref: /vim-8.2.3635/src/testdir/test_menu.vim (revision a1c8ecfd)
1" Test that the system menu can be loaded.
2
3if !has('menu')
4  finish
5endif
6
7func Test_load_menu()
8  try
9    source $VIMRUNTIME/menu.vim
10  catch
11    call assert_false(1, 'error while loading menus: ' . v:exception)
12  endtry
13  call assert_match('browse confirm w', execute(':menu File.Save'))
14  source $VIMRUNTIME/delmenu.vim
15endfunc
16
17func Test_translate_menu()
18  if !has('multi_lang')
19    return
20  endif
21  if !filereadable($VIMRUNTIME . '/lang/menu_de_de.latin1.vim')
22    throw 'Skipped: translated menu not found'
23  endif
24
25  " First delete any English menus.
26  source $VIMRUNTIME/delmenu.vim
27  set langmenu=de_de
28  source $VIMRUNTIME/menu.vim
29  call assert_match('browse confirm w', execute(':menu Datei.Speichern'))
30
31  source $VIMRUNTIME/delmenu.vim
32endfunc
33