annotate src/testdir/test_balloon.vim @ 16951:ebdf6cd89910 v8.1.1476

patch 8.1.1476: no statistics displayed after running tests commit https://github.com/vim/vim/commit/9c0cec65f891492314caadeef87a50251a21e630 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 6 13:38:15 2019 +0200 patch 8.1.1476: no statistics displayed after running tests Problem: No statistics displayed after running tests. Solution: Summarize the test results. (Christian Brabandt, closes https://github.com/vim/vim/issues/4391) Also make it possible to report a skipped file.
author Bram Moolenaar <Bram@vim.org>
date Thu, 06 Jun 2019 13:45:05 +0200
parents 9c90cf08cfa8
children ba7727889385
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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'.
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
16951
ebdf6cd89910 patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
3 if !has('balloon_eval_term')
ebdf6cd89910 patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
4 throw 'Skipped: balloon_eval_term feature missing'
ebdf6cd89910 patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
5 endif
ebdf6cd89910 patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
6
ebdf6cd89910 patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
7 " A few tests only work in the terminal.
ebdf6cd89910 patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
8 if !has('gui_running')
16594
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 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
11 if !CanRunVimInTerminal()
16951
ebdf6cd89910 patch 8.1.1476: no statistics displayed after running tests
Bram Moolenaar <Bram@vim.org>
parents: 16720
diff changeset
12 throw 'Skipped: cannot run Vim in a terminal window'
16594
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 endif
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14
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
15 let s:common_script =<< [CODE]
9c90cf08cfa8 patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents: 16600
diff changeset
16 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
17 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
18 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
19 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
20 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
21 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
22 [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
23
fd0d29d63b85 patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents: 16594
diff changeset
24 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
25 " 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
26 " 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
27 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
28 \ '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
29 \ '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
30 \ ], 'XTest_beval')
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31
16598
fd0d29d63b85 patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents: 16594
diff changeset
32 " 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
33 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
34 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
35 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
36
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 " clean up
6f52e82d9d4e patch 8.1.1300: in a terminal 'ballooneval' does not work right away
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 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
39 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
40 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
41
fd0d29d63b85 patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents: 16594
diff changeset
42 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
43 " 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
44 " 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
45 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
46 \ '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
47 \ '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
48 \ ], '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
49
fd0d29d63b85 patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents: 16594
diff changeset
50 " 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
51 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
52 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
53 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
54
fd0d29d63b85 patch 8.1.1302: v:beval_text is not tested in Visual mode
Bram Moolenaar <Bram@vim.org>
parents: 16594
diff changeset
55 " 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
56 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
57 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
58 endfunc
16600
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
59
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
60 endif
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
61
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
62 " Tests that only work in the GUI
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
63 if has('gui_running')
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
64
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
65 func Test_balloon_show_gui()
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
66 let msg = 'this this this this'
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
67 call balloon_show(msg)
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
68 call assert_equal(msg, balloon_gettext())
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
69 sleep 10m
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
70 call balloon_show('')
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
71
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
72 let msg = 'that that'
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
73 call balloon_show(msg)
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
74 call assert_equal(msg, balloon_gettext())
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
75 sleep 10m
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
76 call balloon_show('')
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
77 endfunc
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
78
ff3c99bd1038 patch 8.1.1303: not possible to hide a balloon
Bram Moolenaar <Bram@vim.org>
parents: 16598
diff changeset
79 endif