0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 9.1.0268: Two tests in test_filechanged.vim are slow

Problem:  Two tests in test_filechanged.vim are slow.
Solution: Sleep for shorter if the +nanotime feature is available.
          (zeertzjq)

closes: #14418

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq 2024-04-05 20:05:11 +02:00 committed by Christian Brabandt
parent c20bdf1107
commit 83cd2c7bf0
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 29 additions and 7 deletions

View File

@ -11,8 +11,12 @@ func Test_FileChangedShell_reload()
new Xchanged_r
call setline(1, 'reload this')
write
" Need to wait until the timestamp would change by at least a second.
sleep 2
" Need to wait until the timestamp would change.
if has('nanotime')
sleep 10m
else
sleep 2
endif
silent !echo 'extra line' >>Xchanged_r
checktime
call assert_equal('changed', g:reason)
@ -50,7 +54,11 @@ func Test_FileChangedShell_reload()
call assert_equal('new line', getline(1))
" Only time changed
sleep 2
if has('nanotime')
sleep 10m
else
sleep 2
endif
silent !touch Xchanged_r
let g:reason = ''
checktime
@ -65,7 +73,11 @@ func Test_FileChangedShell_reload()
call setline(2, 'before write')
write
call setline(2, 'after write')
sleep 2
if has('nanotime')
sleep 10m
else
sleep 2
endif
silent !echo 'different line' >>Xchanged_r
let g:reason = ''
checktime
@ -192,8 +204,12 @@ func Test_file_changed_dialog()
new Xchanged_d
call setline(1, 'reload this')
write
" Need to wait until the timestamp would change by at least a second.
sleep 2
" Need to wait until the timestamp would change.
if has('nanotime')
sleep 10m
else
sleep 2
endif
silent !echo 'extra line' >>Xchanged_d
call feedkeys('L', 'L')
checktime
@ -228,7 +244,11 @@ func Test_file_changed_dialog()
call assert_equal('new line', getline(1))
" Only time changed, no prompt
sleep 2
if has('nanotime')
sleep 10m
else
sleep 2
endif
silent !touch Xchanged_d
let v:warningmsg = ''
checktime Xchanged_d

View File

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