comparison src/testdir/test_textprop.vim @ 29994:86eb4aba16c3 v9.0.0335

patch 9.0.0335: checks for Dictionary argument often give a vague error Commit: https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Tue Aug 30 19:48:24 2022 +0100 patch 9.0.0335: checks for Dictionary argument often give a vague error Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/11009)
author Bram Moolenaar <Bram@vim.org>
date Tue, 30 Aug 2022 21:00:05 +0200
parents e6e0f1c39edb
children adb0de8be4ce
comparison
equal deleted inserted replaced
29993:8dd1900432a0 29994:86eb4aba16c3
1677 1677
1678 " Test for passing invalid arguments to prop_xxx() functions 1678 " Test for passing invalid arguments to prop_xxx() functions
1679 func Test_prop_func_invalid_args() 1679 func Test_prop_func_invalid_args()
1680 call assert_fails('call prop_clear(1, 2, [])', 'E715:') 1680 call assert_fails('call prop_clear(1, 2, [])', 'E715:')
1681 call assert_fails('call prop_clear(-1, 2)', 'E16:') 1681 call assert_fails('call prop_clear(-1, 2)', 'E16:')
1682 call assert_fails('call prop_find(test_null_dict())', 'E715:') 1682 call assert_fails('call prop_find(test_null_dict())', 'E1297:')
1683 call assert_fails('call prop_find({"bufnr" : []})', 'E730:') 1683 call assert_fails('call prop_find({"bufnr" : []})', 'E730:')
1684 call assert_fails('call prop_find({})', 'E968:') 1684 call assert_fails('call prop_find({})', 'E968:')
1685 call assert_fails('call prop_find({}, "x")', 'E474:') 1685 call assert_fails('call prop_find({}, "x")', 'E474:')
1686 call assert_fails('call prop_find({"lnum" : -2})', 'E16:') 1686 call assert_fails('call prop_find({"lnum" : -2})', 'E16:')
1687 call assert_fails('call prop_list(1, [])', 'E715:') 1687 call assert_fails('call prop_list(1, [])', 'E1206:')
1688 call assert_fails('call prop_list(-1, {})', 'E16:') 1688 call assert_fails('call prop_list(-1, {})', 'E16:')
1689 call assert_fails('call prop_remove([])', 'E474:') 1689 call assert_fails('call prop_remove([])', 'E1206:')
1690 call assert_fails('call prop_remove({}, -2)', 'E16:') 1690 call assert_fails('call prop_remove({}, -2)', 'E16:')
1691 call assert_fails('call prop_remove({})', 'E968:') 1691 call assert_fails('call prop_remove({})', 'E968:')
1692 call assert_fails('call prop_type_add([], {})', 'E730:') 1692 call assert_fails('call prop_type_add([], {})', 'E730:')
1693 call assert_fails("call prop_type_change('long', {'xyz' : 10})", 'E971:') 1693 call assert_fails("call prop_type_change('long', {'xyz' : 10})", 'E971:')
1694 call assert_fails("call prop_type_delete([])", 'E730:') 1694 call assert_fails("call prop_type_delete([])", 'E730:')
1697 call assert_fails("call prop_type_get('', [])", 'E474:') 1697 call assert_fails("call prop_type_get('', [])", 'E474:')
1698 call assert_fails("call prop_type_list([])", 'E715:') 1698 call assert_fails("call prop_type_list([])", 'E715:')
1699 call assert_fails("call prop_type_add('yyy', 'not_a_dict')", 'E715:') 1699 call assert_fails("call prop_type_add('yyy', 'not_a_dict')", 'E715:')
1700 call assert_fails("call prop_add(1, 5, {'type':'missing_type', 'length':1})", 'E971:') 1700 call assert_fails("call prop_add(1, 5, {'type':'missing_type', 'length':1})", 'E971:')
1701 call assert_fails("call prop_add(1, 5, {'type': ''})", 'E971:') 1701 call assert_fails("call prop_add(1, 5, {'type': ''})", 'E971:')
1702 call assert_fails('call prop_add(1, 1, 0)', 'E715:') 1702 call assert_fails('call prop_add(1, 1, 0)', 'E1206:')
1703 1703
1704 new 1704 new
1705 call setline(1, ['first', 'second']) 1705 call setline(1, ['first', 'second'])
1706 call prop_type_add('xxx', {}) 1706 call prop_type_add('xxx', {})
1707 1707