Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 1 | " Tests specifically for the GUI features/options that need to be set up at |
| 2 | " startup to take effect at runtime. |
| 3 | |
Bram Moolenaar | 9f0139a | 2017-08-13 20:26:20 +0200 | [diff] [blame] | 4 | source shared.vim |
Bram Moolenaar | 8c5a278 | 2019-08-07 23:07:07 +0200 | [diff] [blame] | 5 | source check.vim |
| 6 | CheckCanRunGui |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 7 | |
| 8 | source setup_gui.vim |
| 9 | |
| 10 | func Setup() |
| 11 | call GUISetUpCommon() |
| 12 | endfunc |
| 13 | |
| 14 | func TearDown() |
| 15 | call GUITearDownCommon() |
| 16 | endfunc |
| 17 | |
Bram Moolenaar | 24d7636 | 2017-03-04 13:32:10 +0100 | [diff] [blame] | 18 | " Ignore the "failed to create input context" error. |
Bram Moolenaar | 5d7ead3 | 2018-02-27 17:17:42 +0100 | [diff] [blame] | 19 | call test_ignore_error('E285:') |
Bram Moolenaar | 24d7636 | 2017-03-04 13:32:10 +0100 | [diff] [blame] | 20 | |
| 21 | " Start the GUI now, in the foreground. |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 22 | gui -f |
| 23 | |
| 24 | func Test_set_guiheadroom() |
Bram Moolenaar | 40bd5a1 | 2021-10-16 21:58:27 +0100 | [diff] [blame] | 25 | CheckX11BasedGui |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 26 | |
Bram Moolenaar | 40bd5a1 | 2021-10-16 21:58:27 +0100 | [diff] [blame] | 27 | " The 'expected' value must be consistent with the value specified with |
| 28 | " gui_init.vim. |
| 29 | call assert_equal(0, &guiheadroom) |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 30 | endfunc |
Bram Moolenaar | 8774845 | 2017-03-12 17:10:33 +0100 | [diff] [blame] | 31 | |
| 32 | func Test_set_guioptions_for_M() |
| 33 | sleep 200ms |
| 34 | " Check if the 'M' option is included. |
| 35 | call assert_match('.*M.*', &guioptions) |
| 36 | endfunc |
| 37 | |
| 38 | func Test_set_guioptions_for_p() |
Bram Moolenaar | 40bd5a1 | 2021-10-16 21:58:27 +0100 | [diff] [blame] | 39 | CheckX11BasedGui |
Bram Moolenaar | 8774845 | 2017-03-12 17:10:33 +0100 | [diff] [blame] | 40 | |
Bram Moolenaar | 40bd5a1 | 2021-10-16 21:58:27 +0100 | [diff] [blame] | 41 | sleep 200ms |
| 42 | " Check if the 'p' option is included. |
| 43 | call assert_match('.*p.*', &guioptions) |
Bram Moolenaar | 8774845 | 2017-03-12 17:10:33 +0100 | [diff] [blame] | 44 | endfunc |
Bram Moolenaar | 6d91bcb | 2020-08-12 18:50:36 +0200 | [diff] [blame] | 45 | |
| 46 | " vim: shiftwidth=2 sts=2 expandtab |