comparison src/testdir/test_lambda.vim @ 21765:08940efa6b4e v8.2.1432

patch 8.2.1432: various inconsistencies in test files Commit: https://github.com/vim/vim/commit/6d91bcb4d23b5c6a0be72c384beaf385e2d9d606 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 12 18:50:36 2020 +0200 patch 8.2.1432: various inconsistencies in test files Problem: Various inconsistencies in test files. Solution: Add modelines where they were missing. Use Check commands instead of silently skipping over tests. Adjust indents and comments. (Ken Takata, closes #6695)
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Aug 2020 19:00:08 +0200
parents 2c4d9ca33769
children ff21e2962490
comparison
equal deleted inserted replaced
21764:476b6faad407 21765:08940efa6b4e
1 " Test for lambda and closure 1 " Test for lambda and closure
2
3 source check.vim
2 4
3 func Test_lambda_feature() 5 func Test_lambda_feature()
4 call assert_equal(1, has('lambda')) 6 call assert_equal(1, has('lambda'))
5 endfunc 7 endfunc
6 8
17 func Test_lambda_with_sort() 19 func Test_lambda_with_sort()
18 call assert_equal([1, 2, 3, 4, 7], sort([3,7,2,1,4], {a, b -> a - b})) 20 call assert_equal([1, 2, 3, 4, 7], sort([3,7,2,1,4], {a, b -> a - b}))
19 endfunc 21 endfunc
20 22
21 func Test_lambda_with_timer() 23 func Test_lambda_with_timer()
22 if !has('timers') 24 CheckFeature timers
23 return
24 endif
25 25
26 let s:n = 0 26 let s:n = 0
27 let s:timer_id = 0 27 let s:timer_id = 0
28 func! s:Foo() 28 func! s:Foo()
29 let s:timer_id = timer_start(10, {-> execute("let s:n += 1 | echo s:n", "")}, {"repeat": -1}) 29 let s:timer_id = timer_start(10, {-> execute("let s:n += 1 | echo s:n", "")}, {"repeat": -1})