Skip to content

Commit 6582299

Browse files
64-bitmanchrisbra
authored andcommitted
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 <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 30ff1e3 commit 6582299

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/evalfunc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7944,7 +7944,11 @@ f_has(typval_T *argvars, typval_T *rettv)
79447944
{
79457945
x = TRUE;
79467946
#ifdef FEAT_CLIPBOARD
7947-
n = clip_plus.available && &clip_star != &clip_plus;
7947+
# ifdef ONE_CLIPBOARD
7948+
n = FALSE;
7949+
# else
7950+
n = clip_plus.available;
7951+
# endif
79487952
#endif
79497953
}
79507954
}

src/testdir/test_clipboard_provider.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ endfunc
3737
" Test if "available" function works properly for provider
3838
func Test_clipboard_provider_available()
3939
CheckUnix
40+
CheckFeature clipboard_plus_avail
41+
4042
let v:clipproviders["test"] = {
4143
\ "available": function("AvailablePlus"),
4244
\ "paste": {

src/testdir/test_eval_stuff.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,17 +746,19 @@ func Test_clipboard_runtime_features()
746746

747747
set clipmethod=evaltest
748748

749-
if has('win32') || has('macunix')
749+
if has('win32') || has('macunix') ||
750+
\ (!has('wayland_clipboard') && !has('xterm_clipboard'))
750751
let g:vim_test_plus = '+'
751752
let g:vim_test_star = '*'
752753
clipreset
753754

754-
" plus register should be disabled on windows or macos
755+
" plus register should be disabled on windows or macos, or if Wayland and
756+
" X11 is not enabled.
755757
call assert_equal(0, has('clipboard_plus_avail'))
756758
call assert_equal(1, has('clipboard_star_avail'))
757759
else
758-
let g:vim_test_plus = '+'
759760
let g:vim_test_star = '*'
761+
let g:vim_test_plus = '+'
760762
clipreset
761763

762764
call assert_equal(1, has('clipboard_plus_avail'))

src/version.c

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

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
1864,
737739
/**/
738740
1863,
739741
/**/

0 commit comments

Comments
 (0)