Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
31965:b6a1e17f049d | 31966:3f39349c5107 |
---|---|
65 " Test for the 'B' flag in 'cpo'. A backslash in mappings, abbreviations, user | 65 " Test for the 'B' flag in 'cpo'. A backslash in mappings, abbreviations, user |
66 " commands and menu commands has no special meaning. | 66 " commands and menu commands has no special meaning. |
67 func Test_cpo_B() | 67 func Test_cpo_B() |
68 let save_cpo = &cpo | 68 let save_cpo = &cpo |
69 new | 69 new |
70 imap <buffer> x<Bslash>k Test | |
70 set cpo-=B | 71 set cpo-=B |
71 iabbr <buffer> abc ab\<BS>d | 72 iabbr <buffer> abc ab\<BS>d |
72 exe "normal iabc " | 73 exe "normal iabc " |
73 call assert_equal('ab<BS>d ', getline(1)) | 74 call assert_equal('ab<BS>d ', getline(1)) |
75 call feedkeys(":imap <buffer> x\<C-A>\<C-B>\"\<CR>", 'tx') | |
76 call assert_equal('"imap <buffer> x\\k', @:) | |
74 %d | 77 %d |
75 set cpo+=B | 78 set cpo+=B |
76 iabbr <buffer> abc ab\<BS>d | 79 iabbr <buffer> abc ab\<BS>d |
77 exe "normal iabc " | 80 exe "normal iabc " |
78 call assert_equal('abd ', getline(1)) | 81 call assert_equal('abd ', getline(1)) |
82 call feedkeys(":imap <buffer> x\<C-A>\<C-B>\"\<CR>", 'tx') | |
83 call assert_equal('"imap <buffer> x\k', @:) | |
79 close! | 84 close! |
80 let &cpo = save_cpo | 85 let &cpo = save_cpo |
81 endfunc | 86 endfunc |
82 | 87 |
83 " Test for the 'c' flag in 'cpo'. | 88 " Test for the 'c' flag in 'cpo'. |
190 call assert_equal('', @%) | 195 call assert_equal('', @%) |
191 %d | 196 %d |
192 set cpo+=f | 197 set cpo+=f |
193 read test_cpoptions.vim | 198 read test_cpoptions.vim |
194 call assert_equal('test_cpoptions.vim', @%) | 199 call assert_equal('test_cpoptions.vim', @%) |
195 close! | 200 |
201 bwipe! | |
196 let &cpo = save_cpo | 202 let &cpo = save_cpo |
197 endfunc | 203 endfunc |
198 | 204 |
199 " Test for the 'F' flag in 'cpo' (write in an empty buffer sets the file name) | 205 " Test for the 'F' flag in 'cpo' (write in an empty buffer sets the file name) |
200 func Test_cpo_F() | 206 func Test_cpo_F() |
436 write >> XfileCpoP | 442 write >> XfileCpoP |
437 call assert_equal('', @%) | 443 call assert_equal('', @%) |
438 set cpo+=P | 444 set cpo+=P |
439 write >> XfileCpoP | 445 write >> XfileCpoP |
440 call assert_equal('XfileCpoP', @%) | 446 call assert_equal('XfileCpoP', @%) |
441 close! | 447 |
448 bwipe! | |
442 let &cpo = save_cpo | 449 let &cpo = save_cpo |
443 endfunc | 450 endfunc |
444 | 451 |
445 " Test for the 'q' flag in 'cpo' (joining multiple lines) | 452 " Test for the 'q' flag in 'cpo' (joining multiple lines) |
446 func Test_cpo_q() | 453 func Test_cpo_q() |