]> granicus.if.org Git - vim/commitdiff
patch 8.2.3463: pattern matching with ModeChanged not tested v8.2.3463
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Oct 2021 20:48:15 +0000 (21:48 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Oct 2021 20:48:15 +0000 (21:48 +0100)
Problem:    Pattern matching with ModeChanged not tested.
Solution:   Add a few more test lines. (issue #8856)

src/testdir/test_edit.vim
src/version.c

index 20683ef954c9391dd5aaf455b7d4b0d20594a78a..6561edc5cd14bd259673ee1163b1b10518115955 100644 (file)
@@ -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
index 27e8365f3b3d61ec8b2f5b4fb4750cc49a500669..f5b36e14d1f96dc6145f9cf2c648740cc1ccadc1 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3463,
 /**/
     3462,
 /**/