annotate src/testdir/test_gui_init.vim @ 15062:3a94f7918980 v8.1.0542

patch 8.1.0542: shiftwidth() does not take 'vartabstop' into account commit https://github.com/vim/vim/commit/f951416a8396a54bbbe21de1a8b16716428549f2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 22 03:08:29 2018 +0100 patch 8.1.0542: shiftwidth() does not take 'vartabstop' into account Problem: shiftwidth() does not take 'vartabstop' into account. Solution: Use the cursor position or a position explicitly passed. Also make >> and << work better with 'vartabstop'. (Christian Brabandt)
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Nov 2018 03:15:10 +0100
parents 33a2277b8d4d
children f38fcbf343ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests specifically for the GUI features/options that need to be set up at
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 " startup to take effect at runtime.
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3
12106
d2c20ec4b95a patch 8.0.0933: terminal test tries to start GUI when it's not possible
Christian Brabandt <cb@256bit.org>
parents: 11119
diff changeset
4 source shared.vim
d2c20ec4b95a patch 8.0.0933: terminal test tries to start GUI when it's not possible
Christian Brabandt <cb@256bit.org>
parents: 11119
diff changeset
5 if !CanRunGui()
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 finish
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 endif
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 source setup_gui.vim
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 func Setup()
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call GUISetUpCommon()
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endfunc
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 func TearDown()
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 call GUITearDownCommon()
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 endfunc
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
11028
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
19 " Ignore the "failed to create input context" error.
13351
33a2277b8d4d patch 8.0.1549: various small problems in test files
Christian Brabandt <cb@256bit.org>
parents: 12106
diff changeset
20 call test_ignore_error('E285:')
11028
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
21
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
22 " Start the GUI now, in the foreground.
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 gui -f
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 func Test_set_guiheadroom()
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 let skipped = ''
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 if !g:x11_based_gui
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 let skipped = g:not_supported . 'guiheadroom'
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 else
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 " The 'expected' value must be consistent with the value specified with
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 " gui_init.vim.
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 call assert_equal(0, &guiheadroom)
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 endif
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 if !empty(skipped)
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 throw skipped
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 endif
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 endfunc
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
40
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
41 func Test_set_guioptions_for_M()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
42 sleep 200ms
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
43 " Check if the 'M' option is included.
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
44 call assert_match('.*M.*', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
45 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
46
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
47 func Test_set_guioptions_for_p()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
48 let skipped = ''
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
49
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
50 if !g:x11_based_gui
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
51 let skipped = g:not_supported . '''p'' of guioptions'
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
52 else
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
53 sleep 200ms
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
54 " Check if the 'p' option is included.
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
55 call assert_match('.*p.*', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
56 endif
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
57
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
58 if !empty(skipped)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
59 throw skipped
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
60 endif
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
61 endfunc