# HG changeset patch # User Christian Brabandt # Date 1712340905 -7200 # Node ID 49637bd5c8632d555f7bda425f8f7aeb330319e5 # Parent 7941cc644258669f1f0092246e9a3ad156f8a50d patch 9.1.0268: Two tests in test_filechanged.vim are slow Commit: https://github.com/vim/vim/commit/83cd2c7bf0c12f05d747dd5fd6abfe103948bf12 Author: zeertzjq 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 Signed-off-by: Christian Brabandt diff --git a/src/testdir/test_filechanged.vim b/src/testdir/test_filechanged.vim --- 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 268, +/**/ 267, /**/ 266,