comparison src/testdir/test_partial.vim @ 9110:6d3888e2232c v7.4.1839

commit https://github.com/vim/vim/commit/2bbf8eff6fab16d86e7bcfc0da1962d31bec7891 Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 24 18:37:12 2016 +0200 patch 7.4.1839 Problem: Cannot get the items stored in a partial. Solution: Support using get() on a partial.
author Christian Brabandt <cb@256bit.org>
date Tue, 24 May 2016 18:45:06 +0200
parents 2242a5766417
children 0cc48b3cd884
comparison
equal deleted inserted replaced
9109:e1d99f1c4436 9110:6d3888e2232c
277 call assert_equal('dict2', dict2.f1()) 277 call assert_equal('dict2', dict2.f1())
278 call assert_equal('dict2', dict2['f1']()) 278 call assert_equal('dict2', dict2['f1']())
279 call assert_equal('dict1', dict2.f2()) 279 call assert_equal('dict1', dict2.f2())
280 call assert_equal('dict1', dict2['f2']()) 280 call assert_equal('dict1', dict2['f2']())
281 endfunc 281 endfunc
282
283 func Test_get_partial_items()
284 let dict = {'name': 'hello'}
285 let Cb = function('MyDictFunc', ["foo", "bar"], dict)
286 call assert_equal('MyDictFunc', get(Cb, 'func'))
287 call assert_equal(["foo", "bar"], get(Cb, 'args'))
288 call assert_equal(dict, get(Cb, 'dict'))
289 call assert_fails('call get(Cb, "xxx")', 'E475:')
290 endfunc