Mercurial > vim
comparison src/testdir/test_expr.vim @ 9717:6226de5f8137 v7.4.2134
commit https://github.com/vim/vim/commit/b54c3ff3174dbb5dfbfcabdf95200b047beaa644
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 31 14:11:58 2016 +0200
patch 7.4.2134
Problem: No error for using function() badly.
Solution: Check for passing wrong function name. (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 31 Jul 2016 14:15:05 +0200 |
parents | 172131507c85 |
children | 80ac9cf77c9b |
comparison
equal
deleted
inserted
replaced
9716:f294f224b8fc | 9717:6226de5f8137 |
---|---|
170 call assert_fails("call substitute('xxx', '.', {m -> string(add(m, 'x'))}, '')", 'E742:') | 170 call assert_fails("call substitute('xxx', '.', {m -> string(add(m, 'x'))}, '')", 'E742:') |
171 call assert_fails("call substitute('xxx', '.', {m -> string(insert(m, 'x'))}, '')", 'E742:') | 171 call assert_fails("call substitute('xxx', '.', {m -> string(insert(m, 'x'))}, '')", 'E742:') |
172 call assert_fails("call substitute('xxx', '.', {m -> string(extend(m, ['x']))}, '')", 'E742:') | 172 call assert_fails("call substitute('xxx', '.', {m -> string(extend(m, ['x']))}, '')", 'E742:') |
173 call assert_fails("call substitute('xxx', '.', {m -> string(remove(m, 1))}, '')", 'E742:') | 173 call assert_fails("call substitute('xxx', '.', {m -> string(remove(m, 1))}, '')", 'E742:') |
174 endfunc | 174 endfunc |
175 | |
176 func Test_function_with_funcref() | |
177 let s:f = function('type') | |
178 let s:fref = function(s:f) | |
179 call assert_equal(v:t_string, s:fref('x')) | |
180 call assert_fails("call function('s:f')", 'E700:') | |
181 endfunc |