changeset 11319:2dc624388934 v8.0.0545

patch 8.0.0545: edit test may fail on some systems commit https://github.com/vim/vim/commit/15ecbd6f3d39ff04862999a577962ef9369a9e53 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 7 14:10:48 2017 +0200 patch 8.0.0545: edit test may fail on some systems Problem: Edit test may fail on some systems. Solution: If creating a directory with a very long path fails, bail out.
author Christian Brabandt <cb@256bit.org>
date Fri, 07 Apr 2017 14:15:07 +0200
parents fa35406bc07e
children cc5d3afd4d9a
files src/testdir/test_edit.vim src/version.c
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -1324,22 +1324,31 @@ func! Test_edit_rightleft()
 endfunc
 
 func Test_edit_complete_very_long_name()
-  if !has('unix') || has('mac')
+  if !has('unix')
     " Long directory names only work on Unix.
     return
   endif
+
+  let dirname = getcwd() . "/Xdir"
+  let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
+  try
+    call mkdir(longdirname, 'p')
+  catch /E739:/
+    " Long directory name probably not supported.
+    call delete(dirname, 'rf')
+    return
+  endtry
+
   " Try to get the Vim window position before setting 'columns'.
   let winposx = getwinposx()
   let winposy = getwinposy()
   let save_columns = &columns
+  " Need at least about 1100 columns to reproduce the problem.
   set columns=2000
   call assert_equal(2000, &columns)
   set noswapfile
 
-  let dirname = getcwd() . "/Xdir"
-  let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
   let longfilename = longdirname . '/' . repeat('a', 255)
-  call mkdir(longdirname, 'p')
   call writefile(['Totum', 'Table'], longfilename)
   new
   exe "next Xfile " . longfilename
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    545,
+/**/
     544,
 /**/
     543,