Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 24254:0868ac82ef18 v8.2.2668
patch 8.2.2668: Vim9: omitting "call" for "confirm()" does not give an error
Commit: https://github.com/vim/vim/commit/f49a1fcdb952ca270f108fcc27bb8ad6922e0807
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 27 22:20:21 2021 +0100
patch 8.2.2668: Vim9: omitting "call" for "confirm()" does not give an error
Problem: Vim9: omitting "call" for "confirm()" does not give an error.
Solution: Do not recognize a modifier followed by "(".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Mar 2021 22:30:02 +0100 |
parents | 01b274c3f69b |
children | 8b4159943d9a |
comparison
equal
deleted
inserted
replaced
24253:5fdc41e253e7 | 24254:0868ac82ef18 |
---|---|
140 | 140 |
141 def Test_browse() | 141 def Test_browse() |
142 CheckFeature browse | 142 CheckFeature browse |
143 | 143 |
144 var lines =<< trim END | 144 var lines =<< trim END |
145 call browse(1, 2, 3, 4) | 145 browse(1, 2, 3, 4) |
146 END | 146 END |
147 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 2') | 147 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 2') |
148 lines =<< trim END | 148 lines =<< trim END |
149 call browse(1, 'title', 3, 4) | 149 browse(1, 'title', 3, 4) |
150 END | 150 END |
151 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 3') | 151 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 3') |
152 lines =<< trim END | 152 lines =<< trim END |
153 call browse(1, 'title', 'dir', 4) | 153 browse(1, 'title', 'dir', 4) |
154 END | 154 END |
155 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 4') | 155 CheckDefExecAndScriptFailure(lines, 'E1174: String required for argument 4') |
156 enddef | 156 enddef |
157 | 157 |
158 def Test_bufexists() | 158 def Test_bufexists() |
234 def Test_confirm() | 234 def Test_confirm() |
235 if !has('dialog_con') && !has('dialog_gui') | 235 if !has('dialog_con') && !has('dialog_gui') |
236 CheckFeature dialog_con | 236 CheckFeature dialog_con |
237 endif | 237 endif |
238 | 238 |
239 assert_fails('call confirm(true)', 'E1174') | 239 assert_fails('confirm(true)', 'E1174') |
240 assert_fails('call confirm("yes", true)', 'E1174') | 240 assert_fails('confirm("yes", true)', 'E1174') |
241 assert_fails('call confirm("yes", "maybe", 2, true)', 'E1174') | 241 assert_fails('confirm("yes", "maybe", 2, true)', 'E1174') |
242 enddef | 242 enddef |
243 | 243 |
244 def Test_copy_return_type() | 244 def Test_copy_return_type() |
245 var l = copy([1, 2, 3]) | 245 var l = copy([1, 2, 3]) |
246 var res = 0 | 246 var res = 0 |