From: zeertzjq Date: Fri, 17 Feb 2023 16:40:20 +0000 (+0000) Subject: patch 9.0.1315: escaping for completion of map command not properly tested X-Git-Tag: v9.0.1315 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3a26c6bff666a368b0a22d35d2e00aa62770f8c;p=vim 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 #12009) --- diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index e1c336a95..ddcb26045 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -327,17 +327,21 @@ func Test_map_completion() call assert_equal('"map ', getreg(':')) call feedkeys(":map \\\"\", 'xt') call assert_equal("\"map \", getreg(':')) + call feedkeys(":map \\\"\", 'xt') + call assert_equal("\"map x", getreg(':')) unmap ,f unmap ,g unmap unmap x - set cpo-=< cpo-=B cpo-=k + set cpo-=< cpo-=k map left call feedkeys(":map \\"\", 'xt') call assert_equal('"map ', getreg(':')) call feedkeys(":map \\"\", 'xt') call assert_equal("\"map ", getreg(':')) + call feedkeys(":map \\\\"\", 'xt') + call assert_equal("\"map \x", getreg(':')) unmap set cpo+=< diff --git a/src/testdir/test_cpoptions.vim b/src/testdir/test_cpoptions.vim index a5822aa3b..6ff8301d6 100644 --- 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 xk Test set cpo-=B iabbr abc ab\d exe "normal iabc " call assert_equal('abd ', getline(1)) + call feedkeys(":imap x\\\"\", 'tx') + call assert_equal('"imap x\\k', @:) %d set cpo+=B iabbr abc ab\d exe "normal iabc " call assert_equal('abd ', getline(1)) + call feedkeys(":imap x\\\"\", 'tx') + call assert_equal('"imap 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 diff --git a/src/version.c b/src/version.c index c9a488b09..47c43e29a 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1315, /**/ 1314, /**/