]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2051: tests: fix Test_cd_completion fails in Appveyor v9.1.2051
authorMuraoka Taro <koron.kaoriya@gmail.com>
Mon, 5 Jan 2026 08:13:18 +0000 (08:13 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 5 Jan 2026 08:13:18 +0000 (08:13 +0000)
Problem:  Test_cd_completion test fails in Appveyor. In Appveyor, a path
          containing spaces was selected as the test target. But the
          comparison failed because spaces were not taken into account
          (after v9.1.2050)
Solution: Escape spaces in paths for comparison (Muraoka Taro)

closes: #19087

Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_cd.vim
src/version.c

index 115688225723fdef1935c3682efa460f582e6acf..6248ee4844729d2263e092164b9819d4c9b4fc98 100644 (file)
@@ -261,22 +261,28 @@ func Test_cd_completion()
     let drive = full[0]
     call chdir(saved_cwd)
 
+    " Spaces are escaped in command line completion. Next, in assert_match(),
+    " the backslash added by the first escape also needs to be escaped
+    " separately, so the escape is doubled.
+    let want_full = escape(escape(full, ' '), '\')
+    let want_dir = escape(escape(dir, ' '), '\')
+
     for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir']
       for sep in [ '/', '\']
 
         " Explicit drive letter
         call feedkeys(':' .. cmd .. ' ' .. drive .. ':' .. sep ..
                      \  partial .. "\<C-A>\<C-B>\"\<CR>", 'tx')
-        call assert_match(full, @:)
+        call assert_match(want_full, @:)
 
         " Implicit drive letter
         call feedkeys(':' .. cmd .. ' ' .. sep .. partial .. "\<C-A>\<C-B>\"\<CR>", 'tx')
-        call assert_match('/' .. dir .. '/', @:)
+        call assert_match('/' .. want_dir .. '/', @:)
 
         " UNC path
         call feedkeys(':' .. cmd .. ' ' .. sep .. sep .. $COMPUTERNAME .. sep ..
                      \ drive .. '$' .. sep .. partial .."\<C-A>\<C-B>\"\<CR>", 'tx')
-        call assert_match('//' .. $COMPUTERNAME .. '/' .. drive .. '$/' .. dir .. '/' , @:)
+        call assert_match('//' .. $COMPUTERNAME .. '/' .. drive .. '$/' .. want_dir .. '/' , @:)
 
       endfor
     endfor
index b724308b58e6234b2994cf5e70580fd956086d59..ce0ef75de1c25b4e80b14778f6d69b85fb475660 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2051,
 /**/
     2050,
 /**/