]> granicus.if.org Git - vim/commitdiff
patch 8.2.0429: no warning when test checks for option that never exists v8.2.0429
authorBram Moolenaar <Bram@vim.org>
Sun, 22 Mar 2020 19:13:39 +0000 (20:13 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 22 Mar 2020 19:13:39 +0000 (20:13 +0100)
Problem:    No warning when test checks for option that never exists.
Solution:   In tests check that the option can exist.

src/testdir/check.vim
src/version.c

index 0bbe7caf94ea1dfc7d820850687e0ec8d8178dca..d01dd81dd56282c6445b7a0727fb516f04d0a587 100644 (file)
@@ -17,6 +17,9 @@ endfunc
 " Command to check for the presence of a working option.
 command -nargs=1 CheckOption call CheckOption(<f-args>)
 func CheckOption(name)
+  if !exists('&' .. a:name)
+    throw 'Checking for non-existent option ' .. a:name
+  endif
   if !exists('+' .. a:name)
     throw 'Skipped: ' .. a:name .. ' option not supported'
   endif
index e27b7735132eebc1001a25d3384372bfffba422f..17918de3aabf7c6a130f5b56767a0a9e45025067 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    429,
 /**/
     428,
 /**/