blob: 055d944b1536395a2e7a80869e46dcd58d408259 [file] [log] [blame]
Bram Moolenaar2d6c8002016-01-03 23:31:24 +01001" Test that the system menu can be loaded.
2
Bram Moolenaar11dd8c12017-03-04 20:41:34 +01003if !has('menu')
4 finish
5endif
6
Bram Moolenaar2d6c8002016-01-03 23:31:24 +01007func Test_load_menu()
8 try
9 source $VIMRUNTIME/menu.vim
10 catch
Bram Moolenaar37175402017-03-18 20:18:45 +010011 call assert_report('error while loading menus: ' . v:exception)
Bram Moolenaar2d6c8002016-01-03 23:31:24 +010012 endtry
Bram Moolenaara1c8ecf2017-03-04 21:41:05 +010013 call assert_match('browse confirm w', execute(':menu File.Save'))
Bram Moolenaar11dd8c12017-03-04 20:41:34 +010014 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
Bram Moolenaara1c8ecf2017-03-04 21:41:05 +010025 " First delete any English menus.
26 source $VIMRUNTIME/delmenu.vim
Bram Moolenaar11dd8c12017-03-04 20:41:34 +010027 set langmenu=de_de
28 source $VIMRUNTIME/menu.vim
Bram Moolenaar5558d192017-03-04 21:02:22 +010029 call assert_match('browse confirm w', execute(':menu Datei.Speichern'))
Bram Moolenaar11dd8c12017-03-04 20:41:34 +010030
31 source $VIMRUNTIME/delmenu.vim
Bram Moolenaar2d6c8002016-01-03 23:31:24 +010032endfunc