]> granicus.if.org Git - vim/commitdiff
patch 8.2.2060: check for features implemented with "if" v8.2.2060
authorBram Moolenaar <Bram@vim.org>
Fri, 27 Nov 2020 18:13:28 +0000 (19:13 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 27 Nov 2020 18:13:28 +0000 (19:13 +0100)
Problem:    Check for features implemented with "if".
Solution:   Use the Check commands. (Ken Takata, closes #7383)

src/testdir/test_autocmd.vim
src/testdir/test_compiler.vim
src/testdir/test_delete.vim
src/testdir/test_diffmode.vim
src/testdir/test_expr.vim
src/testdir/test_fold.vim
src/version.c

index c51f37f0e7db7e6834ea95d7f07d4cd62374ea33..1873a7a3ac05d18209885952e1c77308ae60f5dd 100644 (file)
@@ -1689,9 +1689,7 @@ func Test_change_mark_in_autocmds()
 endfunc
 
 func Test_Filter_noshelltemp()
-  if !executable('cat')
-    return
-  endif
+  CheckExecutable cat
 
   enew!
   call setline(1, ['a', 'b', 'c', 'd'])
index ecf8083cf377eb4f075c8e86df6d3ad7cdab91b2..06a37c9fc564bd5c8bc564137bb44a81ac7a90b9 100644 (file)
@@ -4,9 +4,7 @@ source check.vim
 source shared.vim
 
 func Test_compiler()
-  if !executable('perl')
-    return
-  endif
+  CheckExecutable perl
   CheckFeature quickfix
 
   " $LANG changes the output of Perl.
index b23a3bd025edef819cc6d9d1725ebf38f137b2a1..6b49f153c62525ab5c57722666dbffae4155f80f 100644 (file)
@@ -1,5 +1,7 @@
 " Test for delete().
 
+source check.vim
+
 func Test_file_delete()
   split Xfile
   call setline(1, ['a', 'b'])
@@ -41,9 +43,7 @@ func Test_recursive_delete()
 endfunc
 
 func Test_symlink_delete()
-  if !has('unix')
-    return
-  endif
+  CheckUnix
   split Xfile
   call setline(1, ['a', 'b'])
   wq
@@ -56,9 +56,7 @@ func Test_symlink_delete()
 endfunc
 
 func Test_symlink_dir_delete()
-  if !has('unix')
-    return
-  endif
+  CheckUnix
   call mkdir('Xdir1')
   silent !ln -s Xdir1 Xlink
   call assert_true(isdirectory('Xdir1'))
@@ -70,9 +68,7 @@ func Test_symlink_dir_delete()
 endfunc
 
 func Test_symlink_recursive_delete()
-  if !has('unix')
-    return
-  endif
+  CheckUnix
   call mkdir('Xdir3')
   call mkdir('Xdir3/subdir')
   call mkdir('Xdir4')
index aba9c9a4c02145716ab4db5e70a6510183814b21..2d6228a442ccb91188545fbfbc2709c75585e7ab 100644 (file)
@@ -621,9 +621,7 @@ func Test_diff_move_to()
 endfunc
 
 func Test_diffexpr()
-  if !executable('diff')
-    return
-  endif
+  CheckExecutable diff
 
   func DiffExpr()
     " Prepent some text to check diff type detection
index 754f856c2271059557ec8b303f236edcd110d2a7..dde6e77ba789c4dfa4ba9ba674e4da272c8f964a 100644 (file)
@@ -543,9 +543,7 @@ endfunc
 
 " Test for command-line completion of expressions
 func Test_expr_completion()
-  if !has('cmdline_compl')
-    return
-  endif
+  CheckFeature cmdline_compl
   for cmd in [
        \ 'let a = ',
        \ 'const a = ',
index 1377983ca1dba159f6b73e981e1370076e8fa18a..505ad02392d1a1fe138d09b7106b216ac7e1acba 100644 (file)
@@ -95,9 +95,7 @@ func Test_indent_fold2()
 endfunc
 
 func Test_manual_fold_with_filter()
-  if !executable('cat')
-    return
-  endif
+  CheckExecutable cat
   for type in ['manual', 'marker']
     exe 'set foldmethod=' . type
     new
index 790cf5f2bc3e31799cd320012aa3a9512c6f5014..d86a51e95dc05dcf94ef991c98682e4ce8472647 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2060,
 /**/
     2059,
 /**/