…lines 1–260 unchanged (260 lines)
261 " Get the current drive letter and full path of the target dir
262 call chdir('/' .. dir)
263 let full = getcwd()
264 let drive = full[0]
265 call chdir(saved_cwd)
266
267 " Spaces are escaped in command line completion. Next, in assert_match(),
268 " the backslash added by the first escape also needs to be escaped
269 " separately, so the escape is doubled.
270 let want_full = escape(escape(full, ' '), '\')
271 let want_dir = escape(escape(dir, ' '), '\')
272
273 for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir']
274 for sep in [ '/', '\']
275
276 " Explicit drive letter
277 call feedkeys(':' .. cmd .. ' ' .. drive .. ':' .. sep ..
278 \ partial .. "\<C-A>\<C-B>\"\<CR>", 'tx')
279 call assert_match(want_full, @:)
280
281 " Implicit drive letter
282 call feedkeys(':' .. cmd .. ' ' .. sep .. partial .. "\<C-A>\<C-B>\"\<CR>", 'tx')
283 call assert_match('/' .. want_dir .. '/', @:)
284
285 " UNC path
286 call feedkeys(':' .. cmd .. ' ' .. sep .. sep .. $COMPUTERNAME .. sep ..
287 \ drive .. '$' .. sep .. partial .."\<C-A>\<C-B>\"\<CR>", 'tx')
288 call assert_match('//' .. $COMPUTERNAME .. '/' .. drive .. '$/' .. want_dir .. '/' , @:)
289
290 endfor
291 endfor
292 endif
293endfunc
294
…lines 295–396 unchanged (102 lines)