Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 24246:35603c7991d7 v8.2.2664
patch 8.2.2664: Vim9: not enough function arguments checked for string
Commit: https://github.com/vim/vim/commit/32105ae88f3aa6a6af30336f0bc9f8eb81292cd7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 27 18:59:25 2021 +0100
patch 8.2.2664: Vim9: not enough function arguments checked for string
Problem: Vim9: not enough function arguments checked for string.
Solution: Check in balloon functions. Refactor function arguments.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Mar 2021 19:00:04 +0100 |
parents | a2e6029d354e |
children | 883d7ceffd97 |
comparison
equal
deleted
inserted
replaced
24245:5e22bf689c9f | 24246:35603c7991d7 |
---|---|
123 var res2: bool = append(3, 'two') | 123 var res2: bool = append(3, 'two') |
124 assert_equal(false, res2) | 124 assert_equal(false, res2) |
125 assert_equal(['0', 'one', '1', 'two', '2'], getline(1, 6)) | 125 assert_equal(['0', 'one', '1', 'two', '2'], getline(1, 6)) |
126 enddef | 126 enddef |
127 | 127 |
128 def Test_balloon_show() | |
129 CheckGui | |
130 CheckFeature balloon_eval | |
131 | |
132 assert_fails('balloon_show(true)', 'E1174:') | |
133 enddef | |
134 | |
135 def Test_balloon_split() | |
136 CheckFeature balloon_eval | |
137 | |
138 assert_fails('balloon_split(true)', 'E1174:') | |
139 enddef | |
140 | |
128 def Test_browse() | 141 def Test_browse() |
129 CheckFeature browse | 142 CheckFeature browse |
130 | 143 |
131 var lines =<< trim END | 144 var lines =<< trim END |
132 call browse(1, 2, 3, 4) | 145 call browse(1, 2, 3, 4) |
140 call browse(1, 'title', 'dir', 4) | 153 call browse(1, 'title', 'dir', 4) |
141 END | 154 END |
142 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 4') | 155 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 4') |
143 enddef | 156 enddef |
144 | 157 |
158 def Test_bufexists() | |
159 assert_fails('bufexists(true)', 'E1174') | |
160 enddef | |
161 | |
145 def Test_buflisted() | 162 def Test_buflisted() |
146 var res: bool = buflisted('asdf') | 163 var res: bool = buflisted('asdf') |
147 assert_equal(false, res) | 164 assert_equal(false, res) |
165 assert_fails('buflisted(true)', 'E1174') | |
148 enddef | 166 enddef |
149 | 167 |
150 def Test_bufname() | 168 def Test_bufname() |
151 split SomeFile | 169 split SomeFile |
152 bufname('%')->assert_equal('SomeFile') | 170 bufname('%')->assert_equal('SomeFile') |
174 | 192 |
175 win_gotoid(origwin) | 193 win_gotoid(origwin) |
176 only | 194 only |
177 bwipe SomeFile | 195 bwipe SomeFile |
178 bwipe OtherFile | 196 bwipe OtherFile |
197 | |
198 assert_fails('bufwinid(true)', 'E1138') | |
179 enddef | 199 enddef |
180 | 200 |
181 def Test_call_call() | 201 def Test_call_call() |
182 var l = [3, 2, 1] | 202 var l = [3, 2, 1] |
183 call('reverse', [l]) | 203 call('reverse', [l]) |