blob: 6f22013508a3e26f558040ccb56966bc980a3ffa [file] [log] [blame]
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +01001" Tests specifically for the GUI features/options that need to be set up at
2" startup to take effect at runtime.
3
Bram Moolenaar9f0139a2017-08-13 20:26:20 +02004source shared.vim
Bram Moolenaar8c5a2782019-08-07 23:07:07 +02005source check.vim
6CheckCanRunGui
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +01007
8source setup_gui.vim
9
10func Setup()
11 call GUISetUpCommon()
12endfunc
13
14func TearDown()
15 call GUITearDownCommon()
16endfunc
17
Bram Moolenaar24d76362017-03-04 13:32:10 +010018" Ignore the "failed to create input context" error.
Bram Moolenaar5d7ead32018-02-27 17:17:42 +010019call test_ignore_error('E285:')
Bram Moolenaar24d76362017-03-04 13:32:10 +010020
21" Start the GUI now, in the foreground.
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010022gui -f
23
24func Test_set_guiheadroom()
Bram Moolenaar40bd5a12021-10-16 21:58:27 +010025 CheckX11BasedGui
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010026
Bram Moolenaar40bd5a12021-10-16 21:58:27 +010027 " The 'expected' value must be consistent with the value specified with
28 " gui_init.vim.
29 call assert_equal(0, &guiheadroom)
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010030endfunc
Bram Moolenaar87748452017-03-12 17:10:33 +010031
32func Test_set_guioptions_for_M()
33 sleep 200ms
34 " Check if the 'M' option is included.
35 call assert_match('.*M.*', &guioptions)
36endfunc
37
38func Test_set_guioptions_for_p()
Bram Moolenaar40bd5a12021-10-16 21:58:27 +010039 CheckX11BasedGui
Bram Moolenaar87748452017-03-12 17:10:33 +010040
Bram Moolenaar40bd5a12021-10-16 21:58:27 +010041 sleep 200ms
42 " Check if the 'p' option is included.
43 call assert_match('.*p.*', &guioptions)
Bram Moolenaar87748452017-03-12 17:10:33 +010044endfunc
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +020045
46" vim: shiftwidth=2 sts=2 expandtab