]> granicus.if.org Git - vim/commitdiff
patch 9.0.1315: escaping for completion of map command not properly tested v9.0.1315
authorzeertzjq <zeertzjq@outlook.com>
Fri, 17 Feb 2023 16:40:20 +0000 (16:40 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 17 Feb 2023 16:40:20 +0000 (16:40 +0000)
Problem:    Escaping for completion of map command not properly tested.
Solution:   Add a few test cases. (closes #12009)

src/testdir/test_cmdline.vim
src/testdir/test_cpoptions.vim
src/version.c

index e1c336a950006dbd6413ac56e135ec1a58c1987c..ddcb26045115967ce1f9b932eb3405e9ed78a15a 100644 (file)
@@ -327,17 +327,21 @@ func Test_map_completion()
   call assert_equal('"map <Left>', getreg(':'))
   call feedkeys(":map <A-Left>\<Tab>\<Home>\"\<CR>", 'xt')
   call assert_equal("\"map <A-Left>\<Tab>", getreg(':'))
+  call feedkeys(":map <M-Left>\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal("\"map <M-Left>x", getreg(':'))
   unmap ,f
   unmap ,g
   unmap <Left>
   unmap <A-Left>x
 
-  set cpo-=< cpo-=B cpo-=k
+  set cpo-=< cpo-=k
   map <Left> left
   call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
   call assert_equal('"map <Left>', getreg(':'))
   call feedkeys(":map <M\<Tab>\<Home>\"\<CR>", 'xt')
   call assert_equal("\"map <M\<Tab>", getreg(':'))
+  call feedkeys(":map \<C-V>\<C-V><M\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal("\"map \<C-V><Middle>x", getreg(':'))
   unmap <Left>
 
   set cpo+=<
index a5822aa3bc4f2c9e000db17ad358fc1069db7a0e..6ff8301d6352afa6447892a8fd7510e49f4381f8 100644 (file)
@@ -67,15 +67,20 @@ endfunc
 func Test_cpo_B()
   let save_cpo = &cpo
   new
+  imap <buffer> x<Bslash>k Test
   set cpo-=B
   iabbr <buffer> abc ab\<BS>d
   exe "normal iabc "
   call assert_equal('ab<BS>d ', getline(1))
+  call feedkeys(":imap <buffer> x\<C-A>\<C-B>\"\<CR>", 'tx')
+  call assert_equal('"imap <buffer> x\\k', @:)
   %d
   set cpo+=B
   iabbr <buffer> abc ab\<BS>d
   exe "normal iabc "
   call assert_equal('abd ', getline(1))
+  call feedkeys(":imap <buffer> x\<C-A>\<C-B>\"\<CR>", 'tx')
+  call assert_equal('"imap <buffer> x\k', @:)
   close!
   let &cpo = save_cpo
 endfunc
@@ -192,7 +197,8 @@ func Test_cpo_f()
   set cpo+=f
   read test_cpoptions.vim
   call assert_equal('test_cpoptions.vim', @%)
-  close!
+
+  bwipe!
   let &cpo = save_cpo
 endfunc
 
@@ -438,7 +444,8 @@ func Test_cpo_P()
   set cpo+=P
   write >> XfileCpoP
   call assert_equal('XfileCpoP', @%)
-  close!
+
+  bwipe!
   let &cpo = save_cpo
 endfunc
 
index c9a488b091c73977e6ddf69936b0ae9fb4066cf7..47c43e29a68be700bd5e7a8825625bfb456f9e8b 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1315,
 /**/
     1314,
 /**/