]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1864: tests: Clipboard provider feature test failure v9.1.1864
authorFoxe Chen <chen.foxe@gmail.com>
Fri, 17 Oct 2025 17:30:43 +0000 (17:30 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 17 Oct 2025 17:30:43 +0000 (17:30 +0000)
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>
src/evalfunc.c
src/testdir/test_clipboard_provider.vim
src/testdir/test_eval_stuff.vim
src/version.c

index 17e7adbcb6d0984fd414b68a3136e2a0e6bb63dc..1438f221190771d19bf38408868b64de60793257 100644 (file)
@@ -7944,7 +7944,11 @@ f_has(typval_T *argvars, typval_T *rettv)
        {
            x = TRUE;
 #ifdef FEAT_CLIPBOARD
-           n = clip_plus.available && &clip_star != &clip_plus;
+# ifdef ONE_CLIPBOARD
+           n = FALSE;
+# else
+           n = clip_plus.available;
+# endif
 #endif
        }
     }
index 8cc55c3e35a489b1ee4065137d98f5d5ff90a8e6..ec9bc52343708e223f2681dc3cece13835e8cab2 100644 (file)
@@ -37,6 +37,8 @@ endfunc
 " Test if "available" function works properly for provider
 func Test_clipboard_provider_available()
     CheckUnix
+    CheckFeature clipboard_plus_avail
+
     let v:clipproviders["test"] = {
                 \ "available": function("AvailablePlus"),
                 \ "paste": {
index 0e5c7e9230d17b112a6da9f92304c0584ccbc231..6adfb4d768a5eeb154beb6b3b1d6d0b3efe2adf6 100644 (file)
@@ -746,17 +746,19 @@ func Test_clipboard_runtime_features()
 
   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_star = '*'
     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(1, has('clipboard_star_avail'))
   else
-    let g:vim_test_plus = '+'
     let g:vim_test_star = '*'
+    let g:vim_test_plus = '+'
     clipreset
 
     call assert_equal(1, has('clipboard_plus_avail'))
index 9e05de8a31a53b35205dd9c048008c23fb7faaf3..268d1fc61380199ad3c25403f4c07daf5cc0f721 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1864,
 /**/
     1863,
 /**/