Mercurial > vim
changeset 34788:49637bd5c863 v9.1.0268
patch 9.1.0268: Two tests in test_filechanged.vim are slow
Commit: https://github.com/vim/vim/commit/83cd2c7bf0c12f05d747dd5fd6abfe103948bf12
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri Apr 5 20:05:11 2024 +0200
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Apr 2024 20:15:05 +0200 |
parents | 7941cc644258 |
children | 7512fa13de08 |
files | src/testdir/test_filechanged.vim src/version.c |
diffstat | 2 files changed, 29 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_filechanged.vim +++ b/src/testdir/test_filechanged.vim @@ -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