Mercurial > vim
annotate src/testdir/test_gui.vim @ 10672:0a6c66a06fdb v8.0.0226
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
commit https://github.com/vim/vim/commit/1695f99d08076d77ed3015f1edf09a668a4d449a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 24 13:18:43 2017 +0100
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Problem: The test for patch 8.0.0224 misses the CR characters and passes
even without the fix. (Christian Brabandt)
Solution: Use double quotes and \<CR>.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 24 Jan 2017 13:30:04 +0100 |
parents | 6049c1f01391 |
children | d08655e2633a |
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 |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 " 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
|
8 func SetUp() |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 if has("gui_kde") |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 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
|
11 endif |
9830
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 " Gnome insists on creating $HOME/.gnome2/.. |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
14 call mkdir('Xhome') |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
15 let $HOME = fnamemodify('Xhome', ':p') |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
16 endfunc |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
17 |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
18 func TearDown() |
6049c1f01391
commit https://github.com/vim/vim/commit/50fa8dd00c241fa0786fe92ecc02fee4e5d28e06
Christian Brabandt <cb@256bit.org>
parents:
9760
diff
changeset
|
19 call delete('Xhome', 'rf') |
9756
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 endfunc |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " 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
|
23 " Must be run first. |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 func Test_1_set_secure() |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 set exrc secure |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 gui -f |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal(1, has('gui_running')) |
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 func Test_shell_command() |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 new |
9760
96667173293d
commit https://github.com/vim/vim/commit/9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c
Christian Brabandt <cb@256bit.org>
parents:
9756
diff
changeset
|
32 r !echo hello |
96667173293d
commit https://github.com/vim/vim/commit/9d5b876d458e242b8b5e44da10c5cdc6bbb7f57c
Christian Brabandt <cb@256bit.org>
parents:
9756
diff
changeset
|
33 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
|
34 bwipe! |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 call assert_true(1, match(execute('winpos'), 'Window position: X \d\+, Y \d\+') >= 0) |
00d753ea19a9
commit https://github.com/vim/vim/commit/877e95779869c5426102aa491f67d99904c8534c
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 endfunc |