summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-04-07 14:10:48 +0200
committerBram Moolenaar <Bram@vim.org>2017-04-07 14:10:48 +0200
commit15ecbd6f3d39ff04862999a577962ef9369a9e53 (patch)
treefbf14224edbc3814bdbb05a914d231a331f60193 /src/testdir
parent866c68861071f8cd1ef5a82445bebaafc8626e7e (diff)
downloadvim-git-15ecbd6f3d39ff04862999a577962ef9369a9e53.tar.gz
patch 8.0.0545: edit test may fail on some systemsv8.0.0545
Problem: Edit test may fail on some systems. Solution: If creating a directory with a very long path fails, bail out.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_edit.vim17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index 2df0d6f24..0986bf9b1 100644
--- 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