comparison src/testdir/test_true_false.vim @ 9424:fd4e6d944f4a v7.4.1993

commit https://github.com/vim/vim/commit/6bb450145e96d7b182769fd9502a267da72667ec Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 7 15:11:19 2016 +0200 patch 7.4.1993 Problem: Not all TRUE and FALSE arguments are tested. Solution: Add a few more tests.
author Christian Brabandt <cb@256bit.org>
date Thu, 07 Jul 2016 15:15:06 +0200
parents f93704b11e43
children d606560082e6
comparison
equal deleted inserted replaced
9423:b0d16852621b 9424:fd4e6d944f4a
83 if has('unix') 83 if has('unix')
84 silent !ln -s doesntexit Xlink 84 silent !ln -s doesntexit Xlink
85 call Try_arg_true_false('globpath(".", "Xlink", 0, 0, %v%)', "", "./Xlink") 85 call Try_arg_true_false('globpath(".", "Xlink", 0, 0, %v%)', "", "./Xlink")
86 silent !rm Xlink 86 silent !rm Xlink
87 endif 87 endif
88
89 abbr asdf asdff
90 call Try_arg_true_false('hasmapto("asdff", "i", %v%)', 0, 1)
91
92 call Try_arg_true_false('index(["a", "A"], "A", 0, %v%)', 1, 0)
93
94 call Try_arg_true_false('maparg("asdf", "i", %v%)', "", "asdff")
95 call Try_arg_true_false('maparg("asdf", "i", 1, %v%)', "asdff", {'silent': 0, 'noremap': 0, 'lhs': 'asdf', 'mode': '!', 'nowait': 0, 'expr': 0, 'sid': 3, 'rhs': 'asdff', 'buffer': 0})
96
97 call Try_arg_true_false('hasmapto("asdf", "i", %v%)', 0, 1)
98
99 new colored
100 call setline(1, '<here>')
101 syn match brackets "<.*>"
102 syn match here "here" transparent
103 let brackets_id = synID(1, 1, 0)
104 let here_id = synID(1, 3, 0)
105 call Try_arg_true_false('synID(1, 3, %v%)', here_id, brackets_id)
106 bwipe!
88 endfunc 107 endfunc
89 108
90 function Try_arg_non_zero(expr, false_val, true_val) 109 function Try_arg_non_zero(expr, false_val, true_val)
91 for v in ['v:false', '0', '[1]', '{2:3}', '3.4'] 110 for v in ['v:false', '0', '[1]', '{2:3}', '3.4']
92 let r = eval(substitute(a:expr, '%v%', v, '')) 111 let r = eval(substitute(a:expr, '%v%', v, ''))