diff src/testdir/test_usercommands.vim @ 27680:38eab98ef5a9 v8.2.4366

patch 8.2.4366: not enough tests for command line completion Commit: https://github.com/vim/vim/commit/4d03d870007c593bce2cfa8d0a6597ca3a20fa35 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Feb 13 11:45:09 2022 +0000 patch 8.2.4366: not enough tests for command line completion Problem: Not enough tests for command line completion. Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/9760)
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Feb 2022 13:00:04 +0100
parents 4c16acb2525f
children 3f57b0a8cd29
line wrap: on
line diff
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -384,6 +384,17 @@ func Test_CmdCompletion()
   com! -nargs=? -complete=custom,min DoCmd
   call assert_fails("call feedkeys(':DoCmd \t', 'tx')", 'E118:')
 
+  " custom completion for a pattern with a backslash
+  let g:ArgLead = ''
+  func! CustCompl(A, L, P)
+    let g:ArgLead = a:A
+    return ['one', 'two', 'three']
+  endfunc
+  com! -nargs=? -complete=customlist,CustCompl DoCmd
+  call feedkeys(":DoCmd a\\\t", 'xt')
+  call assert_equal('a\', g:ArgLead)
+  delfunc CustCompl
+
   delcom DoCmd
 endfunc