Skip to content

Commit

Permalink
patch 7.4.889
Browse files Browse the repository at this point in the history
Problem:    Triggering OptionSet from setwinvar() isn't tested.
Solution:   Add a test. (Christian Brabandt)
  • Loading branch information
brammool committed Sep 29, 2015
1 parent ba117c2 commit 74b738d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/testdir/test_autocmd_option.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ STARTTEST
:call setbufvar(1, '&l:bk', 1)
: "should trigger, use correct option name
:call setbufvar(1, '&backup', 1)
:let g:testcase="14: Setting number option using setwinvar\n"
:let g:options=[['number', 0, 1, 'local']]
:call setwinvar(0, '&number', 1)
:" Write register now, because next test shouldn't output anything.
:$put r
:let @r=''
:let g:testcase="\n14: Setting key option, shouldn't trigger\n"
:let g:testcase="\n15: Setting key option, shouldn't trigger\n"
:let g:options=[['key', 'invalid', 'invalid1', 'invalid']]
:setlocal key=blah
:setlocal key=
:$put =g:testcase
:$put r
:/^dummy text/,$w! test.out
:qa!
ENDTEST
Expand Down
7 changes: 6 additions & 1 deletion src/testdir/test_autocmd_option.ok
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ Autocmd Option: <backspace>, OldVal: <>, NewVal: <eol,indent,start>, Scope: <glo
Expected: Name: <backup>, Oldval: <>, NewVal: <1>, Scope: <local>
Autocmd Option: <backup>, OldVal: <0>, NewVal: <1>, Scope: <local>

14: Setting key option, shouldn't trigger
14: Setting number option using setwinvar
Expected: Name: <number>, Oldval: <0>, NewVal: <1>, Scope: <local>
Autocmd Option: <number>, OldVal: <0>, NewVal: <1>, Scope: <local>

15: Setting key option, shouldn't trigger

2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
889,
/**/
888,
/**/
Expand Down

0 comments on commit 74b738d

Please sign in to comment.