Mercurial > vim
comparison src/testdir/screendump.vim @ 13329:424321d6eea7 v8.0.1539
patch 8.0.1539: no test for the popup menu positioning
commit https://github.com/vim/vim/commit/6bb2cdfe604e51eec216cbe23bb6e8fb47810347
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 24 19:53:53 2018 +0100
patch 8.0.1539: no test for the popup menu positioning
Problem: No test for the popup menu positioning.
Solution: Add a screendump test for the popup menu.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 24 Feb 2018 20:00:07 +0100 |
parents | 0dc2e4998a15 |
children | 1ba4f926247c |
comparison
equal
deleted
inserted
replaced
13328:2c639a9a4def | 13329:424321d6eea7 |
---|---|
1 " Functions shared by tests making screen dumps. | 1 " Functions shared by tests making screen dumps. |
2 | 2 |
3 " Only load this script once. | 3 " Only load this script once. |
4 if exists('*RunVimInTerminal') | 4 if exists('*CanRunVimInTerminal') |
5 finish | 5 finish |
6 endif | 6 endif |
7 | |
8 " Need to be able to run terminal Vim with 256 colors. On MS-Windows the | |
9 " console only has 16 colors and the GUI can't run in a terminal. | |
10 if !has('terminal') || has('win32') | |
11 func CanRunVimInTerminal() | |
12 return 0 | |
13 endfunc | |
14 finish | |
15 endif | |
16 | |
17 func CanRunVimInTerminal() | |
18 return 1 | |
19 endfunc | |
7 | 20 |
8 source shared.vim | 21 source shared.vim |
9 | 22 |
10 " Run Vim with "arguments" in a new terminal window. | 23 " Run Vim with "arguments" in a new terminal window. |
11 " By default uses a size of 20 lines and 75 columns. | 24 " By default uses a size of 20 lines and 75 columns. |
39 call WaitFor('term_getstatus(' . a:buf . ') == "finished"') | 52 call WaitFor('term_getstatus(' . a:buf . ') == "finished"') |
40 only! | 53 only! |
41 endfunc | 54 endfunc |
42 | 55 |
43 " Verify that Vim running in terminal buffer "buf" matches the screen dump. | 56 " Verify that Vim running in terminal buffer "buf" matches the screen dump. |
57 " "options" is passed to term_dumpwrite(). | |
44 " The file name used is "dumps/{filename}.dump". | 58 " The file name used is "dumps/{filename}.dump". |
45 " Will wait for up to a second for the screen dump to match. | 59 " Will wait for up to a second for the screen dump to match. |
46 func VerifyScreenDump(buf, filename) | 60 func VerifyScreenDump(buf, filename, options) |
47 let reference = 'dumps/' . a:filename . '.dump' | 61 let reference = 'dumps/' . a:filename . '.dump' |
48 let testfile = a:filename . '.dump.failed' | 62 let testfile = a:filename . '.dump.failed' |
49 | 63 |
50 let i = 0 | 64 let i = 0 |
51 while 1 | 65 while 1 |
52 call delete(testfile) | 66 call delete(testfile) |
53 call term_dumpwrite(a:buf, testfile) | 67 call term_dumpwrite(a:buf, testfile, a:options) |
54 if readfile(reference) == readfile(testfile) | 68 if readfile(reference) == readfile(testfile) |
55 call delete(testfile) | 69 call delete(testfile) |
56 break | 70 break |
57 endif | 71 endif |
58 if i == 100 | 72 if i == 100 |