diff src/testdir/test_cpoptions.vim @ 31966:3f39349c5107 v9.0.1315

patch 9.0.1315: escaping for completion of map command not properly tested Commit: https://github.com/vim/vim/commit/c3a26c6bff666a368b0a22d35d2e00aa62770f8c Author: zeertzjq <zeertzjq@outlook.com> Date: Fri Feb 17 16:40:20 2023 +0000 patch 9.0.1315: escaping for completion of map command not properly tested Problem: Escaping for completion of map command not properly tested. Solution: Add a few test cases. (closes https://github.com/vim/vim/issues/12009)
author Bram Moolenaar <Bram@vim.org>
date Fri, 17 Feb 2023 17:45:05 +0100
parents 4edfa418f8ba
children
line wrap: on
line diff
--- a/src/testdir/test_cpoptions.vim
+++ b/src/testdir/test_cpoptions.vim
@@ -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