# HG changeset patch # User Bram Moolenaar # Date 1563966906 -7200 # Node ID 91cac682b09ac05e96d4f844e2211cff048df35e # Parent 35b73ec0ba2529b19273d7d8b3d92779a43a9f05 patch 8.1.1738: testing lambda with timer is slow commit https://github.com/vim/vim/commit/9bc4dde45d45df732953491d0f2c3fd3b10a627e Author: Bram Moolenaar Date: Wed Jul 24 13:08:29 2019 +0200 patch 8.1.1738: testing lambda with timer is slow Problem: Testing lambda with timer is slow. Solution: Do not test timer accuracy, only that it works. (Daniel Hahler, closes #4723) diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim --- a/src/testdir/test_lambda.vim +++ b/src/testdir/test_lambda.vim @@ -26,20 +26,32 @@ func Test_lambda_with_timer() let s:n = 0 let s:timer_id = 0 func! s:Foo() - "let n = 0 - let s:timer_id = timer_start(50, {-> execute("let s:n += 1 | echo s:n", "")}, {"repeat": -1}) + let s:timer_id = timer_start(10, {-> execute("let s:n += 1 | echo s:n", "")}, {"repeat": -1}) endfunc call s:Foo() - sleep 200ms + " check timer works + for i in range(0, 10) + if s:n > 0 + break + endif + sleep 10m + endfor + " do not collect lambda call test_garbagecollect_now() + + " check timer still works let m = s:n - sleep 200ms + for i in range(0, 10) + if s:n > m + break + endif + sleep 10m + endfor + call timer_stop(s:timer_id) - call assert_true(m > 1) - call assert_true(s:n > m + 1) - call assert_true(s:n < 9) + call assert_true(s:n > m) endfunc func Test_lambda_with_partial() diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1738, +/**/ 1737, /**/ 1736,