diff src/testdir/test_options.vim @ 26500:8088fa133b93 v8.2.3780

patch 8.2.3780: ":cd" works differently on MS-Windows Commit: https://github.com/vim/vim/commit/29f3a4591528130fded3fe1d63d74bcf22ab4f6c Author: Bakudankun <bakudankun@gmail.com> Date: Sat Dec 11 12:28:08 2021 +0000 patch 8.2.3780: ":cd" works differently on MS-Windows Problem: ":cd" works differently on MS-Windows. Solution: Add the 'cdhome' option. (closes https://github.com/vim/vim/issues/9324)
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Dec 2021 13:30:03 +0100
parents c59d60e21ef5
children c1702fd7e716
line wrap: on
line diff
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -1199,4 +1199,25 @@ func Test_opt_scrolljump()
   bw
 endfunc
 
+" Test for the 'cdhome' option
+func Test_opt_cdhome()
+  if has('unix') || has('vms')
+    throw 'Skipped: only works on non-Unix'
+  endif
+
+  set cdhome&
+  call assert_equal(0, &cdhome)
+  set cdhome
+
+  " This paragraph is copied from Test_cd_no_arg().
+  let path = getcwd()
+  cd
+  call assert_equal($HOME, getcwd())
+  call assert_notequal(path, getcwd())
+  exe 'cd ' .. fnameescape(path)
+  call assert_equal(path, getcwd())
+
+  set cdhome&
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab