Bram Moolenaar | 2f10658 | 2019-05-08 21:59:25 +0200 | [diff] [blame] | 1 | " Tests for 'balloonevalterm'. |
| 2 | |
| 3 | if !has('balloon_eval_term') || has('gui_running') |
| 4 | finish |
| 5 | endif |
| 6 | |
| 7 | source screendump.vim |
| 8 | if !CanRunVimInTerminal() |
| 9 | finish |
| 10 | endif |
| 11 | |
| 12 | func 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') |
| 32 | endfunc |