Mercurial > vim
comparison src/testdir/test_vim9_cmd.vim @ 21196:f45ce1ce284c v8.2.1149
patch 8.2.1149: Vim9: :eval command not handled properly
Commit: https://github.com/vim/vim/commit/007f9d6ed597bd212acb95be9d0767c97d2a1438
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jul 6 23:04:49 2020 +0200
patch 8.2.1149: Vim9: :eval command not handled properly
Problem: Vim9: :eval command not handled properly.
Solution: Compile the :eval command. (closes https://github.com/vim/vim/issues/6408)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 06 Jul 2020 23:15:04 +0200 |
parents | 157fe2d26e16 |
children | 874a28fac941 |
comparison
equal
deleted
inserted
replaced
21195:a5fcf0c62367 | 21196:f45ce1ce284c |
---|---|
246 assert_equal(['hello there', 'again'], readfile('Xoutfile')) | 246 assert_equal(['hello there', 'again'], readfile('Xoutfile')) |
247 delete('Xoutfile') | 247 delete('Xoutfile') |
248 endif | 248 endif |
249 enddef | 249 enddef |
250 | 250 |
251 def Test_eval_command() | |
252 let from = 3 | |
253 let to = 5 | |
254 g:val = 111 | |
255 def Increment(nrs: list<number>) | |
256 for nr in nrs | |
257 g:val += nr | |
258 endfor | |
259 enddef | |
260 eval range(from, to) | |
261 ->Increment() | |
262 assert_equal(111 + 3 + 4 + 5, g:val) | |
263 unlet g:val | |
264 enddef | |
265 | |
251 | 266 |
252 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker | 267 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |