blob: e5187557a2cea77d217e181c05e4c718efb0bb78 [file] [log] [blame]
Bram Moolenaar2f106582019-05-08 21:59:25 +02001" Tests for 'balloonevalterm'.
2
3if !has('balloon_eval_term') || has('gui_running')
4 finish
5endif
6
7source screendump.vim
8if !CanRunVimInTerminal()
9 finish
10endif
11
12func Test_balloon_eval_term()
13 call writefile([
14 \ 'call setline(1, ["one one one", "two tXo two", "three three three"])',
15 \ 'set balloonevalterm balloonexpr=MyBalloonExpr() balloondelay=100',
16 \ 'func MyBalloonExpr()',
17 \ ' return "line " . v:beval_lnum . " column " . v:beval_col',
18 \ 'endfun',
19 \ 'redraw',
20 \ 'call test_setmouse(2, 6)',
21 \ 'call feedkeys("\<MouseMove>\<Ignore>", "xt")',
22 \ ], 'XTest_beval')
23
24 " Check that the balloon shows up
25 let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50})
26 call term_wait(buf, 100)
27 call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {})
28
29 " clean up
30 call StopVimInTerminal(buf)
31 call delete('XTest_beval')
32endfunc