Mercurial > vim
annotate src/testdir/test_gui.vim @ 10857:20d71d305d1c v8.0.0318
patch 8.0.0318: small mistake in 7x13 font name
commit https://github.com/vim/vim/commit/a9f8ffb6345f5b246944c73b9861fcc53eaa5228
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 9 16:14:53 2017 +0100
patch 8.0.0318: small mistake in 7x13 font name
Problem: Small mistake in 7x13 font name.
Solution: Use ISO 8859-1 name instead of 10646-1. (Kazunobu Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Feb 2017 16:15:05 +0100 |
parents | 0beffabed338 |
children | 1fce74a5a628 |
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 |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 if !has('gui') || ($DISPLAY == "" && !has('gui_running')) |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 finish |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 endif |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
10841
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
7 let s:x11_based_gui = has('gui_athena') || has('gui_motif') |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
8 \ || has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
9 |
9756
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 " For KDE set a font, empty 'guifont' may cause a hang. |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 func SetUp() |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 if has("gui_kde") |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 set guifont=Courier\ 10\ Pitch/8/-1/5/50/0/0/0/0/0 |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 endif |
9830
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
15 |
10777
80b286d6d38d
patch 8.0.0278: GUI test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
10775
diff
changeset
|
16 " Gnome insists on creating $HOME/.gnome2/, set $HOME to avoid changing the |
80b286d6d38d
patch 8.0.0278: GUI test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
10775
diff
changeset
|
17 " actual home directory. But avoid triggering fontconfig by setting the |
80b286d6d38d
patch 8.0.0278: GUI test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
10775
diff
changeset
|
18 " cache directory. Only needed for Unix. |
80b286d6d38d
patch 8.0.0278: GUI test fails on MS-Windows
Christian Brabandt <cb@256bit.org>
parents:
10775
diff
changeset
|
19 if $XDG_CACHE_HOME == '' && exists('g:tester_HOME') |
10775
d08655e2633a
patch 8.0.0277: the GUI test may trigger fontconfig and take a long time
Christian Brabandt <cb@256bit.org>
parents:
9830
diff
changeset
|
20 let $XDG_CACHE_HOME = g:tester_HOME . '/.cache' |
d08655e2633a
patch 8.0.0277: the GUI test may trigger fontconfig and take a long time
Christian Brabandt <cb@256bit.org>
parents:
9830
diff
changeset
|
21 endif |
9830
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
22 call mkdir('Xhome') |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
23 let $HOME = fnamemodify('Xhome', ':p') |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
24 endfunc |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
25 |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
26 func TearDown() |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
27 call delete('Xhome', 'rf') |
9756
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 endfunc |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 " Test for resetting "secure" flag after GUI has started. |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 " Must be run first. |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 func Test_1_set_secure() |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 set exrc secure |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 gui -f |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 call assert_equal(1, has('gui_running')) |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endfunc |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 |
10847
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
38 func Test_getfontname_with_arg() |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
39 if has('gui_athena') || has('gui_motif') |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
40 " 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
|
41 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
|
42 |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
43 " Valid font name. This is usually the real name of 7x13 by default. |
10857
20d71d305d1c
patch 8.0.0318: small mistake in 7x13 font name
Christian Brabandt <cb@256bit.org>
parents:
10855
diff
changeset
|
44 let l:fname = '-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1' |
10847
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
45 call assert_equal(l:fname, getfontname(l:fname)) |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
46 |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
47 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
|
48 " 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
|
49 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
|
50 |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
51 " Valid font name. This is usually the real name of Monospace by default. |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
52 let l:fname = 'Bitstream Vera Sans Mono 12' |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
53 call assert_equal(l:fname, getfontname(l:fname)) |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
54 else |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
55 throw "Skipped: Matched font name unpredictable to test on this GUI" |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
56 endif |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
57 endfunc |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
58 |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
59 func Test_getfontname_without_arg() |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
60 let l:fname = getfontname() |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
61 if has('gui_kde') |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
62 " 'expected' is the value specified by SetUp() above. |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
63 call assert_equal('Courier 10 Pitch/8/-1/5/50/0/0/0/0/0', l:fname) |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
64 elseif has('gui_athena') || has('gui_motif') |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
65 " 'expected' is DFLT_FONT of gui_x11.c. |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
66 call assert_equal('7x13', l:fname) |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
67 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
|
68 " 'expected' is DEFAULT_FONT of gui_gtk_x11.c. |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
69 call assert_equal('Monospace 10', l:fname) |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
70 else |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
71 throw "Skipped: Default font name unpredictable to test on this GUI" |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
72 endif |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
73 endfunc |
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
74 |
10855
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
75 func Test_set_guifont() |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
76 let l:guifont_saved = &guifont |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
77 if has('xfontset') |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
78 " Prevent 'guifontset' from canceling 'guifont'. |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
79 let l:guifontset_saved = &guifontset |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
80 set guifontset= |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
81 endif |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
82 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
83 let skipped = 0 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
84 if has('gui_athena') || has('gui_motif') |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
85 " 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
|
86 " |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
87 " 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
|
88 " 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
|
89 " '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
|
90 " listed. |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
91 let l:flist = &guifont |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
92 call assert_fails('set guifont=-notexist1-*,-notexist2-*') |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
93 call assert_equal(l:flist, &guifont) |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
94 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
95 " 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
|
96 " valid font. |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
97 set guifont=-notexist1-*,fixed,-notexist2-* |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
98 call assert_equal('fixed', getfontname()) |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
99 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
100 " 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
|
101 set guifont= |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
102 call assert_equal('7x13', getfontname()) |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
103 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
104 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
|
105 " 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
|
106 " '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
|
107 " 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
|
108 " 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
|
109 " font names'. |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
110 " |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
111 " 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
|
112 " 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
|
113 set guifont=(´・ω・`)\ 12,Courier\ 12 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
114 call assert_equal('(´・ω・`) 12', getfontname()) |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
115 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
116 " 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
|
117 set guifont= |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
118 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
|
119 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
120 else |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
121 let skipped = 1 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
122 endif |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
123 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
124 if has('xfontset') |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
125 let &guifontset = l:guifontset_saved |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
126 endif |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
127 let &guifont = l:guifont_saved |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
128 |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
129 if skipped |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
130 throw "Skipped: Test not implemented yet for this GUI" |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
131 endif |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
132 endfunc |
0beffabed338
patch 8.0.0317: no test for setting 'guifont'
Christian Brabandt <cb@256bit.org>
parents:
10847
diff
changeset
|
133 |
10841
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
134 func Test_getwinpos() |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
135 call assert_match('Window position: X \d\+, Y \d\+', execute('winpos')) |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
136 call assert_true(getwinposx() >= 0) |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
137 call assert_true(getwinposy() >= 0) |
10847
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
138 endfunc |
10841
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
139 |
9756
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 func Test_shell_command() |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 new |
9760
96667173293d
commit https://github.com/vim/vim/commit/9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c
Christian Brabandt <cb@256bit.org>
parents:
9756
diff
changeset
|
142 r !echo hello |
96667173293d
commit https://github.com/vim/vim/commit/9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c
Christian Brabandt <cb@256bit.org>
parents:
9756
diff
changeset
|
143 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
|
144 bwipe! |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 endfunc |
10841
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
146 |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
147 func Test_windowid_variable() |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
148 if s:x11_based_gui || has('win32') |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
149 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
|
150 else |
5c0415a8b96e
patch 8.0.0310: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10777
diff
changeset
|
151 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
|
152 endif |
10847
881194ae47a1
patch 8.0.0313: not enough testing for GUI functionality
Christian Brabandt <cb@256bit.org>
parents:
10841
diff
changeset
|
153 endfunc |