Mercurial > vim
annotate src/testdir/test_balloon.vim @ 17200:db81cee3a0e1 v8.1.1599
patch 8.1.1599: compiler warning for uninitialized variable
commit https://github.com/vim/vim/commit/6efd76ae4a5cb60facd261abd5d64800ec96402d
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jun 26 04:06:57 2019 +0200
patch 8.1.1599: compiler warning for uninitialized variable
Problem: Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution: Add a dummy assignment.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 26 Jun 2019 04:15:05 +0200 |
parents | 6990c1160ea5 |
children | 6f1679e1082d |
rev | line source |
---|---|
16594
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Tests for 'balloonevalterm'. |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
2 " A few tests only work in the terminal. |
16594
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
4 if has('gui_running') |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
5 throw 'Skipped: only work in the terminal' |
16951
ebdf6cd89910
patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
6 endif |
ebdf6cd89910
patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
7 |
17089
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
8 source check.vim |
8e9e9124c7a2
patch 8.1.1544: some balloon tests don't run when they can
Bram Moolenaar <Bram@vim.org>
parents:
16965
diff
changeset
|
9 CheckFeature balloon_eval_term |
16594
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 source screendump.vim |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 if !CanRunVimInTerminal() |
16965
ba7727889385
patch 8.1.1483: skipped tests are not properly listed
Bram Moolenaar <Bram@vim.org>
parents:
16951
diff
changeset
|
13 throw 'Skipped: cannot make screendumps' |
16594
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 endif |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 |
17172
6990c1160ea5
patch 8.1.1585: :let-heredoc does not trim enough
Bram Moolenaar <Bram@vim.org>
parents:
17089
diff
changeset
|
16 let s:common_script =<< trim [CODE] |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16600
diff
changeset
|
17 call setline(1, ["one one one", "two tXo two", "three three three"]) |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16600
diff
changeset
|
18 set balloonevalterm balloonexpr=MyBalloonExpr() balloondelay=100 |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16600
diff
changeset
|
19 func MyBalloonExpr() |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16600
diff
changeset
|
20 return "line " .. v:beval_lnum .. " column " .. v:beval_col .. ": " .. v:beval_text |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16600
diff
changeset
|
21 endfun |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16600
diff
changeset
|
22 redraw |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
16600
diff
changeset
|
23 [CODE] |
16598
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
24 |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
25 func Test_balloon_eval_term() |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
26 " Use <Ignore> after <MouseMove> to return from vgetc() without removing |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
27 " the balloon. |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
28 call writefile(s:common_script + [ |
16594
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 \ 'call test_setmouse(2, 6)', |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 \ 'call feedkeys("\<MouseMove>\<Ignore>", "xt")', |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 \ ], 'XTest_beval') |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 |
16598
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
33 " Check that the balloon shows up after a mouse move |
16594
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50}) |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 call term_wait(buf, 100) |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {}) |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 " clean up |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 call StopVimInTerminal(buf) |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 call delete('XTest_beval') |
6f52e82d9d4e
patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 endfunc |
16598
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
42 |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
43 func Test_balloon_eval_term_visual() |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
44 " Use <Ignore> after <MouseMove> to return from vgetc() without removing |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
45 " the balloon. |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
46 call writefile(s:common_script + [ |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
47 \ 'call test_setmouse(3, 6)', |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
48 \ 'call feedkeys("3Gevfr\<MouseMove>\<Ignore>", "xt")', |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
49 \ ], 'XTest_beval_visual') |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
50 |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
51 " Check that the balloon shows up after a mouse move |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
52 let buf = RunVimInTerminal('-S XTest_beval_visual', {'rows': 10, 'cols': 50}) |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
53 call term_wait(buf, 100) |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
54 call VerifyScreenDump(buf, 'Test_balloon_eval_term_02', {}) |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
55 |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
56 " clean up |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
57 call StopVimInTerminal(buf) |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
58 call delete('XTest_beval_visual') |
fd0d29d63b85
patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents:
16594
diff
changeset
|
59 endfunc |