diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-11-27 19:13:28 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-11-27 19:13:28 +0100 |
commit | aeb313f355cd67638e3c611354ce401d86f56afe (patch) | |
tree | eec474c3614ccb296a14b8ad8753bdb91459e964 | |
parent | 6ee874d378829b62e0944063a9a029e81b5debfb (diff) | |
download | vim-git-aeb313f355cd67638e3c611354ce401d86f56afe.tar.gz |
patch 8.2.2060: check for features implemented with "if"v8.2.2060
Problem: Check for features implemented with "if".
Solution: Use the Check commands. (Ken Takata, closes #7383)
-rw-r--r-- | src/testdir/test_autocmd.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_compiler.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_delete.vim | 14 | ||||
-rw-r--r-- | src/testdir/test_diffmode.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_expr.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_fold.vim | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
7 files changed, 12 insertions, 24 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index c51f37f0e..1873a7a3a 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -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']) diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim index ecf8083cf..06a37c9fc 100644 --- a/src/testdir/test_compiler.vim +++ b/src/testdir/test_compiler.vim @@ -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. diff --git a/src/testdir/test_delete.vim b/src/testdir/test_delete.vim index b23a3bd02..6b49f153c 100644 --- a/src/testdir/test_delete.vim +++ b/src/testdir/test_delete.vim @@ -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') diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim index aba9c9a4c..2d6228a44 100644 --- a/src/testdir/test_diffmode.vim +++ b/src/testdir/test_diffmode.vim @@ -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 diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index 754f856c2..dde6e77ba 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -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 = ', diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim index 1377983ca..505ad0239 100644 --- a/src/testdir/test_fold.vim +++ b/src/testdir/test_fold.vim @@ -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 diff --git a/src/version.c b/src/version.c index 790cf5f2b..d86a51e95 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2060, +/**/ 2059, /**/ 2058, |