diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-24 13:08:29 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-24 13:08:29 +0200 |
commit | 9bc4dde45d45df732953491d0f2c3fd3b10a627e (patch) | |
tree | 364e7c40c8b5c3b1d3d6691edef762de81413e7e | |
parent | 949f1989cba8bf7653316c2b1444c26f1536bfab (diff) |
patch 8.1.1738: testing lambda with timer is slowv8.1.1738
Problem: Testing lambda with timer is slow.
Solution: Do not test timer accuracy, only that it works. (Daniel Hahler,
closes #4723)
-rw-r--r-- | src/testdir/test_lambda.vim | 26 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim index 4ff3e20f13..7689219955 100644 --- 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 index 96f4bce893..9eb1e13759 100644 --- 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, |