annotate src/testdir/test_gui.vim @ 17657:0da9bc55c31a v8.1.1826

patch 8.1.1826: tests use hand coded feature and option checks commit https://github.com/vim/vim/commit/8c5a278fc508da6dfe50e69b6ee734451aa4eafb Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 7 23:07:07 2019 +0200 patch 8.1.1826: tests use hand coded feature and option checks Problem: Tests use hand coded feature and option checks. Solution: Use the commands from check.vim in more tests.
author Bram Moolenaar <Bram@vim.org>
date Wed, 07 Aug 2019 23:15:07 +0200
parents 6990c1160ea5
children 131f1d8c5860
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9756
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests specifically for the GUI
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
12106
d2c20ec4b95a patch 8.0.0933: terminal test tries to start GUI when it's not possible
Christian Brabandt <cb@256bit.org>
parents: 11183
diff changeset
3 source shared.vim
17657
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
4 source check.vim
0da9bc55c31a patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents: 17172
diff changeset
5 CheckCanRunGui
9756
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
7 source setup_gui.vim
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
8
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
9 func Setup()
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
10 call GUISetUpCommon()
9830
6049c1f01391 commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents: 9760
diff changeset
11 endfunc
6049c1f01391 commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents: 9760
diff changeset
12
6049c1f01391 commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents: 9760
diff changeset
13 func TearDown()
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
14 call GUITearDownCommon()
9756
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 endfunc
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 " Test for resetting "secure" flag after GUI has started.
13351
33a2277b8d4d patch 8.0.1549: various small problems in test files
Christian Brabandt <cb@256bit.org>
parents: 12106
diff changeset
18 " Must be run first, since it starts the GUI on Unix.
9756
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 func Test_1_set_secure()
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 set exrc secure
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 gui -f
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 call assert_equal(1, has('gui_running'))
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 endfunc
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24
11050
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
25 " As for non-GUI, a balloon_show() test was already added with patch 8.0.0401
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
26 func Test_balloon_show()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
27 if has('balloon_eval')
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
28 " This won't do anything but must not crash either.
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
29 call balloon_show('hi!')
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
30 endif
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
31 endfunc
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
32
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
33 func Test_colorscheme()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
34 let colorscheme_saved = exists('g:colors_name') ? g:colors_name : 'default'
13810
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
35 let g:color_count = 0
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
36 augroup TestColors
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
37 au!
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
38 au ColorScheme * let g:color_count += 1| let g:after_colors = g:color_count
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
39 au ColorSchemePre * let g:color_count += 1 |let g:before_colors = g:color_count
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
40 augroup END
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
41
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
42 colorscheme torte
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
43 redraw!
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
44 call assert_equal('dark', &background)
13810
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
45 call assert_equal(1, g:before_colors)
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
46 call assert_equal(2, g:after_colors)
15394
f20d90aeecaa patch 8.1.0705: :colorscheme isn't tested enough
Bram Moolenaar <Bram@vim.org>
parents: 14756
diff changeset
47 call assert_equal("\ntorte", execute('colorscheme'))
f20d90aeecaa patch 8.1.0705: :colorscheme isn't tested enough
Bram Moolenaar <Bram@vim.org>
parents: 14756
diff changeset
48
f20d90aeecaa patch 8.1.0705: :colorscheme isn't tested enough
Bram Moolenaar <Bram@vim.org>
parents: 14756
diff changeset
49 let a = substitute(execute('hi Search'), "\n\\s\\+", ' ', 'g')
f20d90aeecaa patch 8.1.0705: :colorscheme isn't tested enough
Bram Moolenaar <Bram@vim.org>
parents: 14756
diff changeset
50 call assert_match("\nSearch xxx term=reverse ctermfg=0 ctermbg=12 gui=bold guifg=Black guibg=Red", a)
f20d90aeecaa patch 8.1.0705: :colorscheme isn't tested enough
Bram Moolenaar <Bram@vim.org>
parents: 14756
diff changeset
51
f20d90aeecaa patch 8.1.0705: :colorscheme isn't tested enough
Bram Moolenaar <Bram@vim.org>
parents: 14756
diff changeset
52 call assert_fails('colorscheme does_not_exist', 'E185:')
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
53
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
54 exec 'colorscheme' colorscheme_saved
13810
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
55 augroup TestColors
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
56 au!
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
57 augroup END
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13351
diff changeset
58 unlet g:color_count g:after_colors g:before_colors
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
59 redraw!
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
60 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
61
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
62 func Test_getfontname_with_arg()
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
63 let skipped = ''
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
64
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
65 if !g:x11_based_gui
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
66 let skipped = g:not_implemented
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
67 elseif has('gui_athena') || has('gui_motif')
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
68 " Invalid font name. The result should be an empty string.
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
69 call assert_equal('', getfontname('notexist'))
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
70
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
71 " Valid font name. This is usually the real name of 7x13 by default.
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
72 let fname = '-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1'
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
73 call assert_match(fname, getfontname(fname))
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
74
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
75 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
76 " Invalid font name. The result should be the name plus the default size.
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
77 call assert_equal('notexist 10', getfontname('notexist'))
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
78
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
79 " Valid font name. This is usually the real name of Monospace by default.
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
80 let fname = 'Bitstream Vera Sans Mono 12'
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
81 call assert_equal(fname, getfontname(fname))
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
82 endif
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
83
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
84 if !empty(skipped)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
85 throw skipped
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
86 endif
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
87 endfunc
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
88
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
89 func Test_getfontname_without_arg()
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
90 let skipped = ''
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
91
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
92 let fname = getfontname()
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
93
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
94 if !g:x11_based_gui
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
95 let skipped = g:not_implemented
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
96 elseif has('gui_kde')
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
97 " 'expected' is the value specified by SetUp() above.
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
98 call assert_equal('Courier 10 Pitch/8/-1/5/50/0/0/0/0/0', fname)
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
99 elseif has('gui_athena') || has('gui_motif')
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
100 " 'expected' is DFLT_FONT of gui_x11.c or its real name.
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
101 let pat = '\(7x13\)\|\(\c-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1\)'
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
102 call assert_match(pat, fname)
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
103 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
104 " 'expected' is DEFAULT_FONT of gui_gtk_x11.c.
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
105 call assert_equal('Monospace 10', fname)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
106 endif
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
107
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
108 if !empty(skipped)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
109 throw skipped
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
110 endif
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
111 endfunc
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
112
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
113 func Test_getwinpos()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
114 call assert_match('Window position: X \d\+, Y \d\+', execute('winpos'))
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
115 call assert_true(getwinposx() >= 0)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
116 call assert_true(getwinposy() >= 0)
13940
70e36e1ca442 patch 8.0.1840: getwinpos() is not tested
Christian Brabandt <cb@256bit.org>
parents: 13843
diff changeset
117 call assert_equal([getwinposx(), getwinposy()], getwinpos())
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
118 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
119
10972
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
120 func Test_quoteplus()
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
121 let skipped = ''
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
122
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
123 if !g:x11_based_gui
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
124 let skipped = g:not_supported . 'quoteplus'
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
125 else
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
126 let quoteplus_saved = @+
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
127
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
128 let test_call = 'Can you hear me?'
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
129 let test_response = 'Yes, I can.'
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
130 let vim_exe = exepath(v:progpath)
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
131 let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
11012
ae2de10e8398 patch 8.0.0395: testing the + register fails with Motif
Christian Brabandt <cb@256bit.org>
parents: 11006
diff changeset
132 \ . vim_exe
11028
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 11012
diff changeset
133 \ . ' -u NONE -U NONE --noplugin --not-a-term -c ''%s'''
11012
ae2de10e8398 patch 8.0.0395: testing the + register fails with Motif
Christian Brabandt <cb@256bit.org>
parents: 11006
diff changeset
134 " Ignore the "failed to create input context" error.
11028
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 11012
diff changeset
135 let cmd = 'call test_ignore_error("E285") | '
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 11012
diff changeset
136 \ . 'gui -f | '
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 11012
diff changeset
137 \ . 'call feedkeys("'
10972
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
138 \ . '\"+p'
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
139 \ . ':s/' . test_call . '/' . test_response . '/\<CR>'
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
140 \ . '\"+yis'
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
141 \ . ':q!\<CR>", "tx")'
11028
4df1647531a6 patch 8.0.0403: GUI tests may fail
Christian Brabandt <cb@256bit.org>
parents: 11012
diff changeset
142 let run_vimtest = printf(testee, cmd)
10972
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
143
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
144 " Set the quoteplus register to test_call, and another gvim will launched.
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
145 " Then, it first tries to paste the content of its own quotedplus register
13940
70e36e1ca442 patch 8.0.1840: getwinpos() is not tested
Christian Brabandt <cb@256bit.org>
parents: 13843
diff changeset
146 " onto it. Second, it tries to substitute test_response for the pasted
10972
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
147 " sentence. If the sentence is identical to test_call, the substitution
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
148 " should succeed. Third, it tries to yank the result of the substitution
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
149 " to its own quoteplus register, and last it quits. When system()
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
150 " returns, the content of the quoteplus register should be identical to
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
151 " test_response if those quoteplus registers are synchronized properly
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
152 " with/through the X11 clipboard.
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
153 let @+ = test_call
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
154 call system(run_vimtest)
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
155 call assert_equal(test_response, @+)
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
156
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
157 let @+ = quoteplus_saved
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
158 endif
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
159
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
160 if !empty(skipped)
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
161 throw skipped
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
162 endif
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
163 endfunc
488cda29455b patch 8.0.0375: the "+ register is not tested
Christian Brabandt <cb@256bit.org>
parents: 10944
diff changeset
164
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
165 func Test_set_background()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
166 let background_saved = &background
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
167
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
168 set background&
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
169 call assert_equal('light', &background)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
170
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
171 set background=dark
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
172 call assert_equal('dark', &background)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
173
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
174 let &background = background_saved
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
175 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
176
11050
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
177 func Test_set_balloondelay()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
178 if !exists('+balloondelay')
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
179 return
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
180 endif
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
181
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
182 let balloondelay_saved = &balloondelay
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
183
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
184 " Check if the default value is identical to that described in the manual.
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
185 set balloondelay&
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
186 call assert_equal(600, &balloondelay)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
187
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
188 " Edge cases
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
189
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
190 " XXX This fact should be hidden so that people won't be tempted to write
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
191 " plugin/TimeMachine.vim. TODO Add reasonable range checks to the source
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
192 " code.
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
193 set balloondelay=-1
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
194 call assert_equal(-1, &balloondelay)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
195
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
196 " Though it's possible to interpret the zero delay to be 'as soon as
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
197 " possible' or even 'indefinite', its actual meaning depends on the GUI
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
198 " toolkit in use after all.
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
199 set balloondelay=0
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
200 call assert_equal(0, &balloondelay)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
201
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
202 set balloondelay=1
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
203 call assert_equal(1, &balloondelay)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
204
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
205 " Since p_bdelay is of type long currently, the upper bound can be
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
206 " impractically huge and machine-dependent. Practically, it's sufficient
11052
975f54a391ec patch 8.0.0415: balloon test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 11050
diff changeset
207 " to check if balloondelay works with 0x7fffffff (32 bits) for now.
975f54a391ec patch 8.0.0415: balloon test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 11050
diff changeset
208 set balloondelay=2147483647
975f54a391ec patch 8.0.0415: balloon test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents: 11050
diff changeset
209 call assert_equal(2147483647, &balloondelay)
11050
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
210
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
211 let &balloondelay = balloondelay_saved
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
212 endfunc
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
213
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
214 func Test_set_ballooneval()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
215 if !exists('+ballooneval')
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
216 return
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
217 endif
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
218
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
219 let ballooneval_saved = &ballooneval
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
220
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
221 set ballooneval&
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
222 call assert_equal(0, &ballooneval)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
223
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
224 set ballooneval
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
225 call assert_notequal(0, &ballooneval)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
226
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
227 set noballooneval
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
228 call assert_equal(0, &ballooneval)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
229
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
230 let &ballooneval = ballooneval_saved
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
231 endfunc
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
232
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
233 func Test_set_balloonexpr()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
234 if !exists('+balloonexpr')
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
235 return
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
236 endif
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
237
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
238 let balloonexpr_saved = &balloonexpr
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
239
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
240 " Default value
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
241 set balloonexpr&
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
242 call assert_equal('', &balloonexpr)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
243
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
244 " User-defined function
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
245 new
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
246 func MyBalloonExpr()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
247 return 'Cursor is at line ' . v:beval_lnum .
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
248 \', column ' . v:beval_col .
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
249 \ ' of file ' . bufname(v:beval_bufnr) .
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
250 \ ' on word "' . v:beval_text . '"' .
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
251 \ ' in window ' . v:beval_winid . ' (#' . v:beval_winnr . ')'
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
252 endfunc
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
253 setl balloonexpr=MyBalloonExpr()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
254 setl ballooneval
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
255 call assert_equal('MyBalloonExpr()', &balloonexpr)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
256 " TODO Read non-empty text, place the pointer at a character of a word,
13940
70e36e1ca442 patch 8.0.1840: getwinpos() is not tested
Christian Brabandt <cb@256bit.org>
parents: 13843
diff changeset
257 " and check if the content of the balloon is the same as what is expected.
11050
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
258 " Also, check if textlock works as expected.
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
259 setl balloonexpr&
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
260 call assert_equal('', &balloonexpr)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
261 delfunc MyBalloonExpr
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
262 bwipe!
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
263
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
264 " Multiline support
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
265 if has('balloon_multiline')
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
266 " Multiline balloon using NL
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
267 new
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
268 func MyBalloonFuncForMultilineUsingNL()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
269 return "Multiline\nSuppported\nBalloon\nusing NL"
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
270 endfunc
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
271 setl balloonexpr=MyBalloonFuncForMultilineUsingNL()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
272 setl ballooneval
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
273 call assert_equal('MyBalloonFuncForMultilineUsingNL()', &balloonexpr)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
274 " TODO Read non-empty text, place the pointer at a character of a word,
13940
70e36e1ca442 patch 8.0.1840: getwinpos() is not tested
Christian Brabandt <cb@256bit.org>
parents: 13843
diff changeset
275 " and check if the content of the balloon is the same as what is
11050
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
276 " expected. Also, check if textlock works as expected.
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
277 setl balloonexpr&
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
278 delfunc MyBalloonFuncForMultilineUsingNL
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
279 bwipe!
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
280
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
281 " Multiline balloon using List
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
282 new
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
283 func MyBalloonFuncForMultilineUsingList()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
284 return [ 'Multiline', 'Suppported', 'Balloon', 'using List' ]
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
285 endfunc
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
286 setl balloonexpr=MyBalloonFuncForMultilineUsingList()
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
287 setl ballooneval
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
288 call assert_equal('MyBalloonFuncForMultilineUsingList()', &balloonexpr)
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
289 " TODO Read non-empty text, place the pointer at a character of a word,
13940
70e36e1ca442 patch 8.0.1840: getwinpos() is not tested
Christian Brabandt <cb@256bit.org>
parents: 13843
diff changeset
290 " and check if the content of the balloon is the same as what is
11050
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
291 " expected. Also, check if textlock works as expected.
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
292 setl balloonexpr&
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
293 delfunc MyBalloonFuncForMultilineUsingList
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
294 bwipe!
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
295 endif
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
296
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
297 let &balloonexpr = balloonexpr_saved
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
298 endfunc
622ed5a4925f patch 8.0.0414: balloon eval is not tested
Christian Brabandt <cb@256bit.org>
parents: 11028
diff changeset
299
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
300 " Invalid arguments are tested with test_options in conjunction with segfaults
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
301 " caused by them (Patch 8.0.0357, 24922ec233).
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
302 func Test_set_guicursor()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
303 let guicursor_saved = &guicursor
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
304
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
305 let default = [
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
306 \ "n-v-c:block-Cursor/lCursor",
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
307 \ "ve:ver35-Cursor",
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
308 \ "o:hor50-Cursor",
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
309 \ "i-ci:ver25-Cursor/lCursor",
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
310 \ "r-cr:hor20-Cursor/lCursor",
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
311 \ "sm:block-Cursor-blinkwait175-blinkoff150-blinkon175"
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
312 \ ]
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
313
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
314 " Default Value
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
315 set guicursor&
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
316 call assert_equal(join(default, ','), &guicursor)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
317
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
318 " Argument List Example 1
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
319 let opt_list = copy(default)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
320 let opt_list[0] = "n-c-v:block-nCursor"
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
321 exec "set guicursor=" . join(opt_list, ',')
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
322 call assert_equal(join(opt_list, ','), &guicursor)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
323 unlet opt_list
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
324
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
325 " Argument List Example 2
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
326 let opt_list = copy(default)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
327 let opt_list[3] = "i-ci:ver30-iCursor-blinkwait300-blinkon200-blinkoff150"
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
328 exec "set guicursor=" . join(opt_list, ',')
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
329 call assert_equal(join(opt_list, ','), &guicursor)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
330 unlet opt_list
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
331
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
332 " 'a' Mode
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
333 set guicursor&
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
334 let &guicursor .= ',a:blinkon0'
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
335 call assert_equal(join(default, ',') . ",a:blinkon0", &guicursor)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
336
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
337 let &guicursor = guicursor_saved
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
338 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
339
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
340 func Test_set_guifont()
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
341 let skipped = ''
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
342
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
343 let guifont_saved = &guifont
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
344 if has('xfontset')
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
345 " Prevent 'guifontset' from canceling 'guifont'.
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
346 let guifontset_saved = &guifontset
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
347 set guifontset=
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
348 endif
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
349
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
350 if !g:x11_based_gui
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
351 let skipped = g:not_implemented
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
352 elseif has('gui_athena') || has('gui_motif')
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
353 " Non-empty font list with invalid font names.
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
354 "
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
355 " This test is twofold: (1) It checks if the command fails as expected
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
356 " when there are no loadable fonts found in the list. (2) It checks if
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
357 " 'guifont' remains the same after the command loads none of the fonts
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
358 " listed.
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
359 let flist = &guifont
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
360 call assert_fails('set guifont=-notexist1-*,-notexist2-*')
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
361 call assert_equal(flist, &guifont)
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
362
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
363 " Non-empty font list with a valid font name. Should pick up the first
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
364 " valid font.
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
365 set guifont=-notexist1-*,fixed,-notexist2-*
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
366 let pat = '\(fixed\)\|\(\c-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1\)'
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
367 call assert_match(pat, getfontname())
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
368
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
369 " Empty list. Should fallback to the built-in default.
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
370 set guifont=
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
371 let pat = '\(7x13\)\|\(\c-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO8859-1\)'
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
372 call assert_match(pat, getfontname())
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
373
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
374 elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
375 " For GTK, what we refer to as 'font names' in our manual are actually
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
376 " 'initial font patterns'. A valid font which matches the 'canonical font
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
377 " pattern' constructed from a given 'initial pattern' is to be looked up
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
378 " and loaded. That explains why the GTK GUIs appear to accept 'invalid
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
379 " font names'.
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
380 "
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
381 " Non-empty list. Should always pick up the first element, no matter how
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
382 " strange it is, as explained above.
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
383 set guifont=(´・ω・`)\ 12,Courier\ 12
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
384 call assert_equal('(´・ω・`) 12', getfontname())
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
385
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
386 " Empty list. Should fallback to the built-in default.
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
387 set guifont=
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
388 call assert_equal('Monospace 10', getfontname())
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
389 endif
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
390
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
391 if has('xfontset')
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
392 let &guifontset = guifontset_saved
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
393 endif
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
394 let &guifont = guifont_saved
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
395
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
396 if !empty(skipped)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
397 throw skipped
10855
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
398 endif
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
399 endfunc
0beffabed338 patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents: 10847
diff changeset
400
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
401 func Test_set_guifontset()
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
402 let skipped = ''
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
403
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
404 if !has('xfontset')
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
405 let skipped = g:not_supported . 'xfontset'
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
406 else
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
407 let ctype_saved = v:ctype
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
408
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
409 " First, since XCreateFontSet(3) is very sensitive to locale, fonts must
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
410 " be chosen meticulously.
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
411 let font_head = '-misc-fixed-medium-r-normal--14'
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
412
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
413 let font_aw70 = font_head . '-130-75-75-c-70'
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
414 let font_aw140 = font_head . '-130-75-75-c-140'
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
415
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
416 let font_jisx0201 = font_aw70 . '-jisx0201.1976-0'
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
417 let font_jisx0208 = font_aw140 . '-jisx0208.1983-0'
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
418
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
419 let full_XLFDs = join([ font_jisx0208, font_jisx0201 ], ',')
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
420 let short_XLFDs = join([ font_aw140, font_aw70 ], ',')
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
421 let singleton = font_head . '-*'
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
422 let aliases = 'k14,r14'
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
423
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
424 " Second, among 'locales', look up such a locale that gets 'set
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
425 " guifontset=' to work successfully with every fontset specified with
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
426 " 'fontsets'.
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
427 let locales = [ 'ja_JP.UTF-8', 'ja_JP.eucJP', 'ja_JP.SJIS' ]
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
428 let fontsets = [ full_XLFDs, short_XLFDs, singleton, aliases ]
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
429
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
430 let feasible = 0
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
431 for locale in locales
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
432 try
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
433 exec 'language ctype' locale
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
434 catch /^Vim\%((\a\+)\)\=:E197/
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
435 continue
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
436 endtry
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
437 let done = 0
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
438 for fontset in fontsets
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
439 try
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
440 exec 'set guifontset=' . fontset
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
441 catch /^Vim\%((\a\+)\)\=:E\%(250\|252\|234\|597\|598\)/
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
442 break
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
443 endtry
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
444 let done += 1
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
445 endfor
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
446 if done == len(fontsets)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
447 let feasible = 1
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
448 break
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
449 endif
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
450 endfor
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
451
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
452 " Third, give a set of tests if it is found feasible.
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
453 if !feasible
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
454 let skipped = g:not_hosted
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
455 else
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
456 " N.B. 'v:ctype' has already been set to an appropriate value in the
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
457 " previous loop.
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
458 for fontset in fontsets
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
459 exec 'set guifontset=' . fontset
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
460 call assert_equal(fontset, &guifontset)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
461 endfor
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
462 endif
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
463
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
464 " Finally, restore ctype.
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
465 exec 'language ctype' ctype_saved
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
466 endif
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
467
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
468 if !empty(skipped)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
469 throw skipped
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
470 endif
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
471 endfunc
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
472
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
473 func Test_set_guifontwide()
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
474 let skipped = ''
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
475
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
476 if !g:x11_based_gui
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
477 let skipped = g:not_implemented
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
478 elseif has('gui_gtk')
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
479 let guifont_saved = &guifont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
480 let guifontwide_saved = &guifontwide
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
481
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
482 let fc_match = exepath('fc-match')
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
483 if empty(fc_match)
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
484 let skipped = g:not_hosted
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
485 else
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
486 let &guifont = system('fc-match -f "%{family[0]} %{size}" monospace:size=10:lang=en')
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
487 let wide = system('fc-match -f "%{family[0]} %{size}" monospace:size=10:lang=ja')
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
488 exec 'set guifontwide=' . fnameescape(wide)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
489 call assert_equal(wide, &guifontwide)
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
490 endif
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
491
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
492 let &guifontwide = guifontwide_saved
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
493 let &guifont = guifont_saved
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
494
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
495 elseif has('gui_athena') || has('gui_motif')
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
496 " guifontwide is premised upon the xfontset feature.
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
497 if !has('xfontset')
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
498 let skipped = g:not_supported . 'xfontset'
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
499 else
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
500 let encoding_saved = &encoding
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
501 let guifont_saved = &guifont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
502 let guifontset_saved = &guifontset
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
503 let guifontwide_saved = &guifontwide
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
504
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
505 let nfont = '-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1'
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
506 let wfont = '-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1'
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
507
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
508 set encoding=utf-8
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
509
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
510 " Case 1: guifontset is empty
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
511 set guifontset=
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
512
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
513 " Case 1-1: Automatic selection
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
514 set guifontwide=
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
515 exec 'set guifont=' . nfont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
516 call assert_equal(wfont, &guifontwide)
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
517
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
518 " Case 1-2: Manual selection
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
519 exec 'set guifontwide=' . wfont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
520 exec 'set guifont=' . nfont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
521 call assert_equal(wfont, &guifontwide)
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
522
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
523 " Case 2: guifontset is invalid
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
524 try
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
525 set guifontset=-*-notexist-*
11183
1c4ebbae41d2 patch 8.0.0478: tests use assert_true(0) and assert_false(1) to report errors
Christian Brabandt <cb@256bit.org>
parents: 11119
diff changeset
526 call assert_report("'set guifontset=-*-notexist-*' should have failed")
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
527 catch
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
528 call assert_exception('E598')
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
529 endtry
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
530 " Set it to an invalid value brutally for preparation.
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
531 let &guifontset = '-*-notexist-*'
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
532
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
533 " Case 2-1: Automatic selection
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
534 set guifontwide=
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
535 exec 'set guifont=' . nfont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
536 call assert_equal(wfont, &guifontwide)
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
537
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
538 " Case 2-2: Manual selection
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
539 exec 'set guifontwide=' . wfont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
540 exec 'set guifont=' . nfont
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
541 call assert_equal(wfont, &guifontwide)
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
542
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
543 let &guifontwide = guifontwide_saved
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
544 let &guifontset = guifontset_saved
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
545 let &guifont = guifont_saved
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
546 let &encoding = encoding_saved
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
547 endif
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
548 endif
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
549
10885
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
550 if !empty(skipped)
310834b0256a patch 8.0.0332: GUI test fails on some systems
Christian Brabandt <cb@256bit.org>
parents: 10879
diff changeset
551 throw skipped
10879
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
552 endif
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
553 endfunc
1fce74a5a628 patch 8.0.0329: xfontset and guifontwide are not tested
Christian Brabandt <cb@256bit.org>
parents: 10857
diff changeset
554
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
555 func Test_set_guiheadroom()
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
556 let skipped = ''
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
557
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
558 if !g:x11_based_gui
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
559 let skipped = g:not_supported . 'guiheadroom'
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
560 else
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
561 " Since this script is to be read together with '-U NONE', the default
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
562 " value must be preserved.
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
563 call assert_equal(50, &guiheadroom)
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
564 endif
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
565
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
566 if !empty(skipped)
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
567 throw skipped
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
568 endif
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
569 endfunc
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
570
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
571 func Test_set_guioptions()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
572 let guioptions_saved = &guioptions
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
573 let duration = '200m'
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
574
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
575 if has('win32')
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
576 " Default Value
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
577 set guioptions&
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
578 call assert_equal('egmrLtT', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
579
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
580 else
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
581 " Default Value
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
582 set guioptions&
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
583 call assert_equal('aegimrLtT', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
584
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
585 " To activate scrollbars of type 'L' or 'R'.
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
586 wincmd v
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
587 redraw!
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
588
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
589 " Remove all default GUI ornaments
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
590 set guioptions-=T
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
591 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
592 call assert_equal('aegimrLt', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
593 set guioptions-=t
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
594 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
595 call assert_equal('aegimrL', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
596 set guioptions-=L
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
597 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
598 call assert_equal('aegimr', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
599 set guioptions-=r
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
600 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
601 call assert_equal('aegim', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
602 set guioptions-=m
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
603 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
604 call assert_equal('aegi', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
605
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
606 " Try non-default GUI ornaments
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
607 set guioptions+=l
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
608 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
609 call assert_equal('aegil', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
610 set guioptions-=l
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
611 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
612 call assert_equal('aegi', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
613
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
614 set guioptions+=R
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
615 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
616 call assert_equal('aegiR', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
617 set guioptions-=R
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
618 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
619 call assert_equal('aegi', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
620
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
621 set guioptions+=b
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
622 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
623 call assert_equal('aegib', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
624 set guioptions+=h
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
625 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
626 call assert_equal('aegibh', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
627 set guioptions-=h
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
628 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
629 call assert_equal('aegib', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
630 set guioptions-=b
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
631 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
632 call assert_equal('aegi', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
633
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
634 set guioptions+=v
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
635 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
636 call assert_equal('aegiv', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
637 set guioptions-=v
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
638 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
639 call assert_equal('aegi', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
640
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
641 if has('gui_motif')
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
642 set guioptions+=F
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
643 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
644 call assert_equal('aegiF', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
645 set guioptions-=F
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
646 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
647 call assert_equal('aegi', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
648 endif
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
649
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
650 " Restore GUI ornaments to the default state.
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
651 set guioptions+=m
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
652 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
653 call assert_equal('aegim', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
654 set guioptions+=r
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
655 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
656 call assert_equal('aegimr', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
657 set guioptions+=L
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
658 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
659 call assert_equal('aegimrL', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
660 set guioptions+=t
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
661 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
662 call assert_equal('aegimrLt', &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
663 set guioptions+=T
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
664 exec 'sleep' . duration
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
665 call assert_equal("aegimrLtT", &guioptions)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
666
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
667 wincmd o
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
668 redraw!
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
669 endif
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
670
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
671 let &guioptions = guioptions_saved
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
672 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
673
14756
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
674 func Test_scrollbars()
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
675 new
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
676 " buffer with 200 lines
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
677 call setline(1, repeat(['one', 'two'], 100))
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
678 set guioptions+=rlb
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
679
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
680 " scroll to move line 11 at top, moves the cursor there
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
681 call test_scrollbar('left', 10, 0)
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
682 redraw
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
683 call assert_equal(1, winline())
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
684 call assert_equal(11, line('.'))
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
685
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
686 " scroll to move line 1 at top, cursor stays in line 11
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
687 call test_scrollbar('right', 0, 0)
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
688 redraw
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
689 call assert_equal(11, winline())
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
690 call assert_equal(11, line('.'))
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
691
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
692 set nowrap
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
693 call setline(11, repeat('x', 150))
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
694 redraw
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
695 call assert_equal(1, wincol())
16963
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
696 set number
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
697 redraw
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
698 call assert_equal(5, wincol())
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
699 set nonumber
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
700 redraw
14756
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
701 call assert_equal(1, col('.'))
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
702
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
703 " scroll to character 11, cursor is moved
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
704 call test_scrollbar('hor', 10, 0)
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
705 redraw
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
706 call assert_equal(1, wincol())
16963
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
707 set number
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
708 redraw
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
709 call assert_equal(5, wincol())
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
710 set nonumber
1fbb0a33b074 patch 8.1.1482: no test for wincol() depending on the 'number' option
Bram Moolenaar <Bram@vim.org>
parents: 16121
diff changeset
711 redraw
14756
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
712 call assert_equal(11, col('.'))
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
713
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
714 set guioptions&
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
715 set wrap&
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
716 bwipe!
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
717 endfunc
a179e5cfcab7 patch 8.1.0390: scrollbars are not tested
Christian Brabandt <cb@256bit.org>
parents: 13940
diff changeset
718
16121
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
719 func Test_menu()
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
720 " Check Help menu exists
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
721 let help_menu = execute('menu Help')
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
722 call assert_match('Overview', help_menu)
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
723
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
724 " Check Help menu works
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
725 emenu Help.Overview
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
726 call assert_equal('help', &buftype)
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
727 close
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
728
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
729 " Check deleting menu doesn't cause trouble.
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
730 aunmenu Help
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
731 call assert_fails('menu Help', 'E329:')
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
732 endfunc
060b58b492a5 patch 8.1.1065: no test for using and deleting menu in the GUI
Bram Moolenaar <Bram@vim.org>
parents: 16119
diff changeset
733
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
734 func Test_set_guipty()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
735 let guipty_saved = &guipty
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
736
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
737 " Default Value
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
738 set guipty&
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
739 call assert_equal(1, &guipty)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
740
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
741 set noguipty
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
742 call assert_equal(0, &guipty)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
743
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
744 let &guipty = guipty_saved
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
745 endfunc
10841
5c0415a8b96e patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10777
diff changeset
746
16119
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
747 func Test_encoding_conversion()
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
748 " GTK supports conversion between 'encoding' and "utf-8"
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
749 if has('gui_gtk')
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
750 let encoding_saved = &encoding
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
751 set encoding=latin1
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
752
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
753 " would be nice if we could take a screenshot
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
754 intro
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
755 " sets the window title
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
756 edit SomeFile
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
757
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
758 let &encoding = encoding_saved
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
759 endif
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
760 endfunc
4fac64b51d74 patch 8.1.1064: no test for output conversion in the GTK GUI
Bram Moolenaar <Bram@vim.org>
parents: 15394
diff changeset
761
9756
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
762 func Test_shell_command()
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
763 new
9760
96667173293d commit https://github.com/vim/vim/commit/9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c
Christian Brabandt <cb@256bit.org>
parents: 9756
diff changeset
764 r !echo hello
96667173293d commit https://github.com/vim/vim/commit/9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c
Christian Brabandt <cb@256bit.org>
parents: 9756
diff changeset
765 call assert_equal('hello', substitute(getline(2), '\W', '', 'g'))
9756
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
766 bwipe!
00d753ea19a9 commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
767 endfunc
10841
5c0415a8b96e patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10777
diff changeset
768
11119
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
769 func Test_syntax_colortest()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
770 runtime syntax/colortest.vim
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
771 redraw!
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
772 sleep 200m
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
773 bwipe!
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
774 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
775
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
776 func Test_set_term()
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
777 " It's enough to check the current value since setting 'term' to anything
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
778 " other than builtin_gui makes no sense at all.
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
779 call assert_equal('builtin_gui', &term)
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
780 endfunc
d8a550329a97 patch 8.0.0447: getting font name does not work on X11
Christian Brabandt <cb@256bit.org>
parents: 11052
diff changeset
781
10841
5c0415a8b96e patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10777
diff changeset
782 func Test_windowid_variable()
10944
4e2cdce4576c patch 8.0.0361: GUI initialisation is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents: 10885
diff changeset
783 if g:x11_based_gui || has('win32')
10841
5c0415a8b96e patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10777
diff changeset
784 call assert_true(v:windowid > 0)
5c0415a8b96e patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10777
diff changeset
785 else
5c0415a8b96e patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10777
diff changeset
786 call assert_equal(0, v:windowid)
5c0415a8b96e patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10777
diff changeset
787 endif
10847
881194ae47a1 patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents: 10841
diff changeset
788 endfunc
13843
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
789
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
790 " Test "vim -g" and also the GUIEnter autocommand.
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
791 func Test_gui_dash_g()
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
792 let cmd = GetVimCommand('Xscriptgui')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
793 call writefile([""], "Xtestgui")
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
794 let lines =<< trim END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
795 au GUIEnter * call writefile(["insertmode: " . &insertmode], "Xtestgui")
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
796 au GUIEnter * qall
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
797 END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
798 call writefile(lines, 'Xscriptgui')
13843
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
799 call system(cmd . ' -g')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
800 call WaitForAssert({-> assert_equal(['insertmode: 0'], readfile('Xtestgui'))})
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
801
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
802 call delete('Xscriptgui')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
803 call delete('Xtestgui')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
804 endfunc
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
805
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
806 " Test "vim -7" and also the GUIEnter autocommand.
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
807 func Test_gui_dash_y()
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
808 let cmd = GetVimCommand('Xscriptgui')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
809 call writefile([""], "Xtestgui")
17172
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
810 let lines =<< trim END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
811 au GUIEnter * call writefile(["insertmode: " . &insertmode], "Xtestgui")
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
812 au GUIEnter * qall
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
813 END
6990c1160ea5 patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents: 17089
diff changeset
814 call writefile(lines, 'Xscriptgui')
13843
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
815 call system(cmd . ' -y')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
816 call WaitForAssert({-> assert_equal(['insertmode: 1'], readfile('Xtestgui'))})
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
817
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
818 call delete('Xscriptgui')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
819 call delete('Xtestgui')
619730d0d864 patch 8.0.1793: no test for "vim -g"
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
820 endfunc