Skip to content

Commit aeb313f

Browse files
committed
patch 8.2.2060: check for features implemented with "if"
Problem: Check for features implemented with "if". Solution: Use the Check commands. (Ken Takata, closes #7383)
1 parent 6ee874d commit aeb313f

7 files changed

Lines changed: 12 additions & 24 deletions

File tree

src/testdir/test_autocmd.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,9 +1689,7 @@ func Test_change_mark_in_autocmds()
16891689
endfunc
16901690

16911691
func Test_Filter_noshelltemp()
1692-
if !executable('cat')
1693-
return
1694-
endif
1692+
CheckExecutable cat
16951693

16961694
enew!
16971695
call setline(1, ['a', 'b', 'c', 'd'])

src/testdir/test_compiler.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ source check.vim
44
source shared.vim
55

66
func Test_compiler()
7-
if !executable('perl')
8-
return
9-
endif
7+
CheckExecutable perl
108
CheckFeature quickfix
119

1210
" $LANG changes the output of Perl.

src/testdir/test_delete.vim

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
" Test for delete().
22

3+
source check.vim
4+
35
func Test_file_delete()
46
split Xfile
57
call setline(1, ['a', 'b'])
@@ -41,9 +43,7 @@ func Test_recursive_delete()
4143
endfunc
4244

4345
func Test_symlink_delete()
44-
if !has('unix')
45-
return
46-
endif
46+
CheckUnix
4747
split Xfile
4848
call setline(1, ['a', 'b'])
4949
wq
@@ -56,9 +56,7 @@ func Test_symlink_delete()
5656
endfunc
5757

5858
func Test_symlink_dir_delete()
59-
if !has('unix')
60-
return
61-
endif
59+
CheckUnix
6260
call mkdir('Xdir1')
6361
silent !ln -s Xdir1 Xlink
6462
call assert_true(isdirectory('Xdir1'))
@@ -70,9 +68,7 @@ func Test_symlink_dir_delete()
7068
endfunc
7169

7270
func Test_symlink_recursive_delete()
73-
if !has('unix')
74-
return
75-
endif
71+
CheckUnix
7672
call mkdir('Xdir3')
7773
call mkdir('Xdir3/subdir')
7874
call mkdir('Xdir4')

src/testdir/test_diffmode.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,7 @@ func Test_diff_move_to()
621621
endfunc
622622

623623
func Test_diffexpr()
624-
if !executable('diff')
625-
return
626-
endif
624+
CheckExecutable diff
627625

628626
func DiffExpr()
629627
" Prepent some text to check diff type detection

src/testdir/test_expr.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,7 @@ endfunc
543543

544544
" Test for command-line completion of expressions
545545
func Test_expr_completion()
546-
if !has('cmdline_compl')
547-
return
548-
endif
546+
CheckFeature cmdline_compl
549547
for cmd in [
550548
\ 'let a = ',
551549
\ 'const a = ',

src/testdir/test_fold.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ func Test_indent_fold2()
9595
endfunc
9696

9797
func Test_manual_fold_with_filter()
98-
if !executable('cat')
99-
return
100-
endif
98+
CheckExecutable cat
10199
for type in ['manual', 'marker']
102100
exe 'set foldmethod=' . type
103101
new

src/version.c

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

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2060,
753755
/**/
754756
2059,
755757
/**/

0 commit comments

Comments
 (0)