Mercurial > vim
comparison src/testdir/test_lambda.vim @ 19724:b3e93a05c3ca v8.2.0418
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Commit: https://github.com/vim/vim/commit/8b633135106dda8605463b780573c45b00c22afe
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 20 18:20:51 2020 +0100
patch 8.2.0418: code in eval.c not sufficiently covered by tests
Problem: Code in eval.c not sufficiently covered by tests.
Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5815)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 20 Mar 2020 18:30:05 +0100 |
parents | 2a017e9dc6da |
children | 293a22b677a8 |
comparison
equal
deleted
inserted
replaced
19723:16aa117306ec | 19724:b3e93a05c3ca |
---|---|
61 | 61 |
62 function Test_lambda_fails() | 62 function Test_lambda_fails() |
63 call assert_equal(3, {a, b -> a + b}(1, 2)) | 63 call assert_equal(3, {a, b -> a + b}(1, 2)) |
64 call assert_fails('echo {a, a -> a + a}(1, 2)', 'E853:') | 64 call assert_fails('echo {a, a -> a + a}(1, 2)', 'E853:') |
65 call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E15:') | 65 call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E15:') |
66 echo assert_fails('echo 10->{a -> a + 2}', 'E107:') | |
66 endfunc | 67 endfunc |
67 | 68 |
68 func Test_not_lamda() | 69 func Test_not_lamda() |
69 let x = {'>' : 'foo'} | 70 let x = {'>' : 'foo'} |
70 call assert_equal('foo', x['>']) | 71 call assert_equal('foo', x['>']) |
307 | 308 |
308 func Test_lambda_error() | 309 func Test_lambda_error() |
309 " This was causing a crash | 310 " This was causing a crash |
310 call assert_fails('ec{@{->{d->()()', 'E15') | 311 call assert_fails('ec{@{->{d->()()', 'E15') |
311 endfunc | 312 endfunc |
313 | |
314 " vim: shiftwidth=2 sts=2 expandtab |