Mercurial > vim
comparison src/testdir/test_lambda.vim @ 26636:6047c7ea7963 v8.2.3847
patch 8.2.3847: illegal memory access when using a lambda with an error
Commit: https://github.com/vim/vim/commit/605ec91e5a7330d61be313637e495fa02a6dc264
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 18 16:54:31 2021 +0000
patch 8.2.3847: illegal memory access when using a lambda with an error
Problem: Illegal memory access when using a lambda with an error.
Solution: Avoid skipping over the NUL after a string.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 18 Dec 2021 18:00:03 +0100 |
parents | 12fd67997953 |
children | a35d54d01ade |
comparison
equal
deleted
inserted
replaced
26635:788251bf42b4 | 26636:6047c7ea7963 |
---|---|
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)', 'E451:') | 65 call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E451:') |
66 echo assert_fails('echo 10->{a -> a + 2}', 'E107:') | 66 echo assert_fails('echo 10->{a -> a + 2}', 'E107:') |
67 | |
68 call assert_fails('eval 0->(', "E110: Missing ')'") | |
67 endfunc | 69 endfunc |
68 | 70 |
69 func Test_not_lamda() | 71 func Test_not_lamda() |
70 let x = {'>' : 'foo'} | 72 let x = {'>' : 'foo'} |
71 call assert_equal('foo', x['>']) | 73 call assert_equal('foo', x['>']) |