comparison src/testdir/test_functions.vim @ 23108:34a74f5f0fb4 v8.2.2100

patch 8.2.2100: insufficient testing for function range and dict Commit: https://github.com/vim/vim/commit/67322bf74a106b6476b093e75da87d61e2181b76 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 6 15:03:19 2020 +0100 patch 8.2.2100: insufficient testing for function range and dict Problem: Insufficient testing for function range and dict. Solution: Add a few tests. (Dominique Pell?, closes https://github.com/vim/vim/issues/7428)
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Dec 2020 15:15:04 +0100
parents 4ba6c5eebb28
children 2351b40af967
comparison
equal deleted inserted replaced
23107:6daa688e0e24 23108:34a74f5f0fb4
2097 return len(self.data) 2097 return len(self.data)
2098 endfunction 2098 endfunction
2099 let mydict = {'data': [0, 1, 2, 3], 'len': function("Mylen")} 2099 let mydict = {'data': [0, 1, 2, 3], 'len': function("Mylen")}
2100 eval mydict.len->call([], mydict)->assert_equal(4) 2100 eval mydict.len->call([], mydict)->assert_equal(4)
2101 call assert_fails("call call('Mylen', [], 0)", 'E715:') 2101 call assert_fails("call call('Mylen', [], 0)", 'E715:')
2102 call assert_fails('call foo', 'E107:')
2102 endfunc 2103 endfunc
2103 2104
2104 func Test_char2nr() 2105 func Test_char2nr()
2105 call assert_equal(12354, char2nr('あ', 1)) 2106 call assert_equal(12354, char2nr('あ', 1))
2106 call assert_equal(120, 'x'->char2nr()) 2107 call assert_equal(120, 'x'->char2nr())