while (vim_ispathsep(*p));
}
start = p; // remember start after "c:/" or "/" or "///"
+#ifdef UNIX
+ // Posix says that "//path" is unchanged but "///path" is "/path".
+ if (start > filename + 2)
+ {
+ STRMOVE(filename + 1, p);
+ start = p = filename + 1;
+ }
+#endif
do
{
call assert_equal('/', simplify('/.'))
call assert_equal('/', simplify('/..'))
call assert_equal('/...', simplify('/...'))
+ call assert_equal('//path', simplify('//path'))
+ call assert_equal('/path', simplify('///path'))
+ call assert_equal('/path', simplify('////path'))
+
call assert_equal('./dir/file', './dir/file'->simplify())
call assert_equal('./dir/file', simplify('.///dir//file'))
call assert_equal('./dir/file', simplify('./dir/./file'))
" Test for the inputdialog() function
func Test_inputdialog()
+ set timeout timeoutlen=10
if has('gui_running')
call assert_fails('let v=inputdialog([], "xx")', 'E730:')
call assert_fails('let v=inputdialog("Q", [])', 'E730:')
call feedkeys(":let v=inputdialog('Q:', 'xx', 'yy')\<CR>\<Esc>", 'xt')
call assert_equal('yy', v)
endif
+ set timeout& timeoutlen&
endfunc
" Test for inputlist()
\ ->map({-> v:val.name})
call sort(files)->assert_equal(['bar.txt', 'dir', 'foo.txt'])
- " report brocken link correctly
+ " report broken link correctly
if has("unix")
call writefile([], 'Xdir/abc.txt')
call system("ln -s Xdir/abc.txt Xdir/link")