Skip to content

Commit

Permalink
patch 8.2.3463: pattern matching with ModeChanged not tested
Browse files Browse the repository at this point in the history
Problem:    Pattern matching with ModeChanged not tested.
Solution:   Add a few more test lines. (issue #8856)
  • Loading branch information
brammool committed Oct 2, 2021
1 parent d85931e commit 72d2fa6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/testdir/test_edit.vim
Expand Up @@ -1932,10 +1932,31 @@ func Test_mode_changes()
call assert_equal(4, g:count)
call assert_equal(len(g:mode_seq) - 1, g:index)

let g:n_to_i = 0
au ModeChanged n:i let g:n_to_i += 1
let g:n_to_niI = 0
au ModeChanged i:niI let g:n_to_niI += 1
let g:niI_to_i = 0
au ModeChanged niI:i let g:niI_to_i += 1
let g:nany_to_i = 0
au ModeChanged n*:i let g:nany_to_i += 1
let g:i_to_n = 0
au ModeChanged i:n let g:i_to_n += 1
let g:nori_to_any = 0
au ModeChanged [ni]:* let g:nori_to_any += 1
let g:i_to_any = 0
au ModeChanged i:* let g:i_to_any += 1
let g:index = 0
let g:mode_seq = ['n', 'i', 'niI', 'i', 'n']
call feedkeys("a\<C-O>l\<esc>", 'tnix')
call assert_equal(len(g:mode_seq) - 1, g:index)
call assert_equal(1, g:n_to_i)
call assert_equal(1, g:n_to_niI)
call assert_equal(1, g:niI_to_i)
call assert_equal(2, g:nany_to_i)
call assert_equal(1, g:i_to_n)
call assert_equal(2, g:i_to_any)
call assert_equal(3, g:nori_to_any)

au! ModeChanged
delfunc TestMode
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -757,6 +757,8 @@ static char *(features[]) =

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

0 comments on commit 72d2fa6

Please sign in to comment.