0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.0.0292: the stat test is a bit slow

Problem:    The stat test is a bit slow.
Solution:   Remove a couple of sleep comments and reduce another.
This commit is contained in:
Bram Moolenaar
2017-02-01 22:05:28 +01:00
parent 23fa81d222
commit a2f28859bf
2 changed files with 23 additions and 14 deletions

View File

@@ -4,17 +4,17 @@ func Test_existent_file()
let fname = 'Xtest.tmp' let fname = 'Xtest.tmp'
let ts = localtime() let ts = localtime()
sleep 1
let fl = ['Hello World!'] let fl = ['Hello World!']
call writefile(fl, fname) call writefile(fl, fname)
let tf = getftime(fname) let tf = getftime(fname)
sleep 1
let te = localtime() let te = localtime()
call assert_true(ts <= tf && tf <= te) call assert_true(ts <= tf && tf <= te)
call assert_equal(strlen(fl[0] . "\n"), getfsize(fname)) call assert_equal(strlen(fl[0] . "\n"), getfsize(fname))
call assert_equal('file', getftype(fname)) call assert_equal('file', getftype(fname))
call assert_equal('rw-', getfperm(fname)[0:2]) call assert_equal('rw-', getfperm(fname)[0:2])
call delete(fname)
endfunc endfunc
func Test_existent_directory() func Test_existent_directory()
@@ -32,12 +32,19 @@ func Test_checktime()
call writefile(fl, fname) call writefile(fl, fname)
set autoread set autoread
exec 'e' fname exec 'e' fname
" FAT has a granularity of 2 seconds, otherwise it's usually 1 second
if has('win32')
sleep 2 sleep 2
else
sleep 1
endif
let fl = readfile(fname) let fl = readfile(fname)
let fl[0] .= ' - checktime' let fl[0] .= ' - checktime'
call writefile(fl, fname) call writefile(fl, fname)
checktime checktime
call assert_equal(fl[0], getline(1)) call assert_equal(fl[0], getline(1))
call delete(fname)
endfunc endfunc
func Test_nonexistent_file() func Test_nonexistent_file()

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
292,
/**/ /**/
291, 291,
/**/ /**/