Skip to content

Commit 7db209f

Browse files
brammooldouglaskayama
authored andcommitted
updated for version 7.4.608
Problem: test_eval fails when the clipboard feature is missing. Solution: Skip part of the test. Reduce the text used.
1 parent e030b90 commit 7db209f

3 files changed

Lines changed: 24 additions & 11 deletions

File tree

src/testdir/test_eval.in

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ Test for various eval features. vim: set ft=vim :
22

33
Note: system clipboard is saved, changed and restored.
44

5+
clipboard contents
6+
something else
7+
58
STARTTEST
69
:so small.vim
710
:set encoding=latin1
811
:set noswapfile
912
:lang C
1013
:fun AppendRegContents(reg)
11-
call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1))))
14+
call AppendRegParts(a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1)))
15+
:endfun
16+
:fun AppendRegParts(reg, type, cont, strcont, cont1, strcont1)
17+
call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, a:type, a:cont, a:strcont, a:cont1, a:strcont1))
1218
endfun
1319
:command -nargs=? AR :call AppendRegContents(<q-args>)
1420
:fun SetReg(...)
@@ -122,18 +128,23 @@ call SetReg('/', ["abc/\n"])
122128
call SetReg('=', ['"abc/"'])
123129
call SetReg('=', ["\"abc/\n\""])
124130
$put ='{{{1 System clipboard'
131+
if has('clipboard')
125132
" Save and restore system clipboard.
126133
" If no connection to X-Server is possible, test should succeed.
127-
:let _clipreg = ['+', getreg('+'), getregtype('+')]
128-
:let _clipopt = &cb
129-
:let &cb='unnamedplus'
130-
:1y
131-
:AR +
132-
:tabdo :windo :echo "hi"
133-
:3y
134-
:AR +
135-
:let &cb=_clipopt
136-
:call call('setreg', _clipreg)
134+
let _clipreg = ['+', getreg('+'), getregtype('+')]
135+
let _clipopt = &cb
136+
let &cb='unnamedplus'
137+
5y
138+
AR +
139+
tabdo :windo :echo "hi"
140+
6y
141+
AR +
142+
let &cb=_clipopt
143+
call call('setreg', _clipreg)
144+
else
145+
call AppendRegParts('+', 'V', "clipboard contents\n", "['clipboard contents']", "clipboard contents\n", "['clipboard contents']")
146+
call AppendRegParts('+', 'V', "something else\n", "['something else']", "something else\n", "['something else']")
147+
endif
137148
$put ='{{{1 Errors'
138149
call ErrExe('call setreg()')
139150
call ErrExe('call setreg(1)')

src/testdir/test_eval.ok

-292 Bytes
Binary file not shown.

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
608,
744746
/**/
745747
607,
746748
/**/

0 commit comments

Comments
 (0)