Skip to content

Commit a15dfc2

Browse files
committed
patch 9.1.0872: No test for W23 message
Problem: No test for W23 message Solution: Check for W23 message when accessing the clipboard fails (after v9.1.0868) closes: #16076 Signed-off-by: Christian Brabandt <[email protected]>
1 parent a73dfc2 commit a15dfc2

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

src/testdir/test_registers.vim

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ func Test_insert_small_delete_replace_mode()
10451045
bwipe!
10461046
endfunc
10471047

1048-
" Test for W23 when clipboard is not available
1048+
" Test for W24 when clipboard support is not available
10491049
func Test_clipboard_regs_not_working()
10501050
CheckNotGui
10511051
if !has("clipboard")
@@ -1057,4 +1057,29 @@ func Test_clipboard_regs_not_working()
10571057
endif
10581058
endfunc
10591059

1060+
" Check for W23 with a Vim with clipboard support,
1061+
" but when the connection to the X11 server does not work
1062+
func Test_clipboard_regs_not_working2()
1063+
CheckNotMac
1064+
CheckRunVimInTerminal
1065+
CheckFeature clipboard
1066+
let display=$DISPLAY
1067+
unlet $DISPLAY
1068+
" Run in a separate Vim instance because changing 'encoding' may cause
1069+
" trouble for later tests.
1070+
let lines =<< trim END
1071+
unlet $DISPLAY
1072+
call setline(1, 'abcdefg')
1073+
let a=execute(':norm! "+yy')
1074+
call writefile([a], 'Xclipboard_result.txt')
1075+
END
1076+
call writefile(lines, 'XTest_clipboard', 'D')
1077+
let buf = RunVimInTerminal('-S XTest_clipboard', {})
1078+
call term_sendkeys(buf, "\"+yy")
1079+
call StopVimInTerminal(buf)
1080+
let result = readfile('Xclipboard_result.txt')
1081+
call assert_match("^\\nW23:", result[0])
1082+
let $DISPLAY=display
1083+
endfunc
1084+
10601085
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

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

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
872,
707709
/**/
708710
871,
709711
/**/

0 commit comments

Comments
 (0)