0
0
mirror of https://github.com/vim/vim.git synced 2025-10-21 08:24:06 -04:00

patch 9.1.1864: tests: Clipboard provider feature test failure

Problem:  tests: Clipboard provider feature test failure
Solution: Check in the test that the + clipboard register is available,
          fix compile warning (Foxe Chen)

closes: #18586

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Foxe Chen
2025-10-17 17:30:43 +00:00
committed by Christian Brabandt
parent 30ff1e3b02
commit 6582299b8d
4 changed files with 14 additions and 4 deletions

View File

@@ -7944,7 +7944,11 @@ f_has(typval_T *argvars, typval_T *rettv)
{ {
x = TRUE; x = TRUE;
#ifdef FEAT_CLIPBOARD #ifdef FEAT_CLIPBOARD
n = clip_plus.available && &clip_star != &clip_plus; # ifdef ONE_CLIPBOARD
n = FALSE;
# else
n = clip_plus.available;
# endif
#endif #endif
} }
} }

View File

@@ -37,6 +37,8 @@ endfunc
" Test if "available" function works properly for provider " Test if "available" function works properly for provider
func Test_clipboard_provider_available() func Test_clipboard_provider_available()
CheckUnix CheckUnix
CheckFeature clipboard_plus_avail
let v:clipproviders["test"] = { let v:clipproviders["test"] = {
\ "available": function("AvailablePlus"), \ "available": function("AvailablePlus"),
\ "paste": { \ "paste": {

View File

@@ -746,17 +746,19 @@ func Test_clipboard_runtime_features()
set clipmethod=evaltest set clipmethod=evaltest
if has('win32') || has('macunix') if has('win32') || has('macunix') ||
\ (!has('wayland_clipboard') && !has('xterm_clipboard'))
let g:vim_test_plus = '+' let g:vim_test_plus = '+'
let g:vim_test_star = '*' let g:vim_test_star = '*'
clipreset clipreset
" plus register should be disabled on windows or macos " plus register should be disabled on windows or macos, or if Wayland and
" X11 is not enabled.
call assert_equal(0, has('clipboard_plus_avail')) call assert_equal(0, has('clipboard_plus_avail'))
call assert_equal(1, has('clipboard_star_avail')) call assert_equal(1, has('clipboard_star_avail'))
else else
let g:vim_test_plus = '+'
let g:vim_test_star = '*' let g:vim_test_star = '*'
let g:vim_test_plus = '+'
clipreset clipreset
call assert_equal(1, has('clipboard_plus_avail')) call assert_equal(1, has('clipboard_plus_avail'))

View File

@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1864,
/**/ /**/
1863, 1863,
/**/ /**/