diff src/testdir/test_options.vim @ 13664:f64c5e636c9f v8.0.1704

patch 8.0.1704: 'backupskip' default doesn't work for Mac commit https://github.com/vim/vim/commit/b8e22a053b68774dfd86fd829d9dba2333f09c05 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 12 21:37:34 2018 +0200 patch 8.0.1704: 'backupskip' default doesn't work for Mac Problem: 'backupskip' default doesn't work for Mac. Solution: Use "/private/tmp". (Rainer M?ller, closes https://github.com/vim/vim/issues/2793)
author Christian Brabandt <cb@256bit.org>
date Thu, 12 Apr 2018 21:45:06 +0200
parents 2334a8ae9ff6
children 9d3ddfa88a56
line wrap: on
line diff
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -332,3 +332,19 @@ func Test_set_indentexpr()
   call assert_equal('', &indentexpr)
   bwipe!
 endfunc
+
+func Test_backupskip()
+  if has("mac")
+    call assert_match('/private/tmp/\*', &bsk)
+  elseif has("unix")
+    call assert_match('/tmp/\*', &bsk)
+  endif
+
+  let bskvalue = substitute(&bsk, '\\', '/', 'g')
+  for var in  ['$TEMPDIR', '$TMP', '$TEMP']
+    if exists(var)
+      let varvalue = substitute(expand(var), '\\', '/', 'g')
+      call assert_match(varvalue . '.\*', bskvalue)
+    endif
+  endfor
+endfunc