Patch 8.0.0292
Problem: The stat test is a bit slow.
Solution: Remove a couple of sleep comments and reduce another.
Files: src/testdir/test_stat.vim
*** ../vim-8.0.0291/src/testdir/test_stat.vim 2016-07-01 17:04:48.000000000
+0200
--- src/testdir/test_stat.vim 2017-02-01 22:03:36.215184398 +0100
***************
*** 1,24 ****
" Tests for stat functions and checktime
func Test_existent_file()
! let fname='Xtest.tmp'
! let ts=localtime()
! sleep 1
! let fl=['Hello World!']
call writefile(fl, fname)
! let tf=getftime(fname)
! sleep 1
! let te=localtime()
call assert_true(ts <= tf && tf <= te)
call assert_equal(strlen(fl[0] . "\n"), getfsize(fname))
call assert_equal('file', getftype(fname))
call assert_equal('rw-', getfperm(fname)[0:2])
endfunc
func Test_existent_directory()
! let dname='.'
call assert_equal(0, getfsize(dname))
call assert_equal('dir', getftype(dname))
--- 1,24 ----
" Tests for stat functions and checktime
func Test_existent_file()
! let fname = 'Xtest.tmp'
! let ts = localtime()
! let fl = ['Hello World!']
call writefile(fl, fname)
! let tf = getftime(fname)
! let te = localtime()
call assert_true(ts <= tf && tf <= te)
call assert_equal(strlen(fl[0] . "\n"), getfsize(fname))
call assert_equal('file', getftype(fname))
call assert_equal('rw-', getfperm(fname)[0:2])
+
+ call delete(fname)
endfunc
func Test_existent_directory()
! let dname = '.'
call assert_equal(0, getfsize(dname))
call assert_equal('dir', getftype(dname))
***************
*** 26,47 ****
endfunc
func Test_checktime()
! let fname='Xtest.tmp'
! let fl=['Hello World!']
call writefile(fl, fname)
set autoread
exec 'e' fname
! sleep 2
! let fl=readfile(fname)
let fl[0] .= ' - checktime'
call writefile(fl, fname)
checktime
call assert_equal(fl[0], getline(1))
endfunc
func Test_nonexistent_file()
! let fname='Xtest.tmp'
call delete(fname)
call assert_equal(-1, getftime(fname))
--- 26,54 ----
endfunc
func Test_checktime()
! let fname = 'Xtest.tmp'
! let fl = ['Hello World!']
call writefile(fl, fname)
set autoread
exec 'e' fname
! " FAT has a granularity of 2 seconds, otherwise it's usually 1 second
! if has('win32')
! sleep 2
! else
! sleep 1
! endif
! let fl = readfile(fname)
let fl[0] .= ' - checktime'
call writefile(fl, fname)
checktime
call assert_equal(fl[0], getline(1))
+
+ call delete(fname)
endfunc
func Test_nonexistent_file()
! let fname = 'Xtest.tmp'
call delete(fname)
call assert_equal(-1, getftime(fname))
***************
*** 55,61 ****
" So we use an existing symlink for this test.
if has('win32')
" Check if 'C:\Users\All Users' is a symlink to a directory.
! let res=system('dir C:\Users /a')
if match(res, '\C<SYMLINKD> *All Users') >= 0
" Get the filetype of the symlink.
call assert_equal('dir', getftype('C:\Users\All Users'))
--- 62,68 ----
" So we use an existing symlink for this test.
if has('win32')
" Check if 'C:\Users\All Users' is a symlink to a directory.
! let res = system('dir C:\Users /a')
if match(res, '\C<SYMLINKD> *All Users') >= 0
" Get the filetype of the symlink.
call assert_equal('dir', getftype('C:\Users\All Users'))
*** ../vim-8.0.0291/src/version.c 2017-02-01 21:50:16.740465816 +0100
--- src/version.c 2017-02-01 22:04:27.674844474 +0100
***************
*** 766,767 ****
--- 766,769 ----
{ /* Add new patch number below this line */
+ /**/
+ 292,
/**/
--
Sorry, no fortune today.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.