Compare commits

...

5 Commits

Author SHA1 Message Date
Bram Moolenaar
335c8c7b20 patch 8.2.3260: build failure with small features
Problem:    Build failure with small features.
Solution:   Add #ifdef.
2021-07-31 21:44:35 +02:00
Bram Moolenaar
620c959c6c patch 8.2.3259: when 'indentexpr' causes an error did_throw may hang
Problem:    When 'indentexpr' causes an error the did_throw flag may remain
            set.
Solution:   Reset did_throw and show the error. (closes #8677)
2021-07-31 21:32:31 +02:00
Bram Moolenaar
78db17c6f3 patch 8.2.3258: error messages have the wrong text
Problem:    Error messages have the wrong text.
Solution:   Adjust the error message.
2021-07-31 19:12:58 +02:00
Bram Moolenaar
8e3fc135e8 patch 8.2.3257: calling prop_find() with -1 for ID gives errornous error
Problem:    Calling prop_find() with -1 for ID gives errornous error. (Naohiro
            Ono)
Solution:   When passing -1 use -2. (closes #8674)
2021-07-31 18:33:57 +02:00
Bram Moolenaar
bf634a0a8b patch 8.2.3256: executable test may fail on new Ubuntu system
Problem:    Executable test may fail on new Ubuntu system.
Solution:   Consider /usr/bin/cat and /bin/cat the same.
2021-07-31 17:20:04 +02:00
10 changed files with 134 additions and 99 deletions

View File

@@ -628,17 +628,17 @@ EXTERN char e_string_or_blob_required_for_argument_nr[]
EXTERN char e_string_or_list_required_for_argument_nr[]
INIT(= N_("E1222: String or List required for argument %d"));
EXTERN char e_string_or_dict_required_for_argument_nr[]
INIT(= N_("E1223: String or List required for argument %d"));
EXTERN char e_string_or_number_or_list_required_for_argument_nr[]
INIT(= N_("E1224: String or List required for argument %d"));
EXTERN char e_string_or_list_or_dict_required_for_argument_nr[]
INIT(= N_("E1225: String or List required for argument %d"));
INIT(= N_("E1223: String or Dictionary required for argument %d"));
EXTERN char e_string_number_or_list_required_for_argument_nr[]
INIT(= N_("E1224: String, Number or List required for argument %d"));
EXTERN char e_string_list_or_dict_required_for_argument_nr[]
INIT(= N_("E1225: String, List or Dictionary required for argument %d"));
EXTERN char e_list_or_blob_required_for_argument_nr[]
INIT(= N_("E1226: String or List required for argument %d"));
INIT(= N_("E1226: List or Blob required for argument %d"));
EXTERN char e_list_or_dict_required_for_argument_nr[]
INIT(= N_("E1227: List or Dictionary required for argument %d"));
EXTERN char e_list_or_dict_or_blob_required_for_argument_nr[]
INIT(= N_("E1228: List or Dictionary or Blob required for argument %d"));
EXTERN char e_list_dict_or_blob_required_for_argument_nr[]
INIT(= N_("E1228: List, Dictionary or Blob required for argument %d"));
EXTERN char e_expected_dictionary_for_using_key_str_but_got_str[]
INIT(= N_("E1229: Expected dictionary for using key \"%s\", but got %s"));
EXTERN char e_encryption_sodium_mlock_failed[]

View File

@@ -1268,67 +1268,7 @@ do_cmdline(
* commands are executed.
*/
if (did_throw)
{
char *p = NULL;
msglist_T *messages = NULL;
/*
* If the uncaught exception is a user exception, report it as an
* error. If it is an error exception, display the saved error
* message now. For an interrupt exception, do nothing; the
* interrupt message is given elsewhere.
*/
switch (current_exception->type)
{
case ET_USER:
vim_snprintf((char *)IObuff, IOSIZE,
_("E605: Exception not caught: %s"),
current_exception->value);
p = (char *)vim_strsave(IObuff);
break;
case ET_ERROR:
messages = current_exception->messages;
current_exception->messages = NULL;
break;
case ET_INTERRUPT:
break;
}
estack_push(ETYPE_EXCEPT, current_exception->throw_name,
current_exception->throw_lnum);
ESTACK_CHECK_SETUP
current_exception->throw_name = NULL;
discard_current_exception(); // uses IObuff if 'verbose'
suppress_errthrow = TRUE;
force_abort = TRUE;
if (messages != NULL)
{
do
{
msglist_T *next = messages->next;
int save_compiling = estack_compiling;
estack_compiling = messages->msg_compiling;
emsg(messages->msg);
vim_free(messages->msg);
vim_free(messages->sfile);
vim_free(messages);
messages = next;
estack_compiling = save_compiling;
}
while (messages != NULL);
}
else if (p != NULL)
{
emsg(p);
vim_free(p);
}
vim_free(SOURCING_NAME);
ESTACK_CHECK_NOW
estack_pop();
}
handle_did_throw();
/*
* On an interrupt or an aborting error not converted to an exception,
@@ -1448,7 +1388,74 @@ do_cmdline(
return retval;
}
#ifdef FEAT_EVAL
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Handle when "did_throw" is set after executing commands.
*/
void
handle_did_throw()
{
char *p = NULL;
msglist_T *messages = NULL;
/*
* If the uncaught exception is a user exception, report it as an
* error. If it is an error exception, display the saved error
* message now. For an interrupt exception, do nothing; the
* interrupt message is given elsewhere.
*/
switch (current_exception->type)
{
case ET_USER:
vim_snprintf((char *)IObuff, IOSIZE,
_("E605: Exception not caught: %s"),
current_exception->value);
p = (char *)vim_strsave(IObuff);
break;
case ET_ERROR:
messages = current_exception->messages;
current_exception->messages = NULL;
break;
case ET_INTERRUPT:
break;
}
estack_push(ETYPE_EXCEPT, current_exception->throw_name,
current_exception->throw_lnum);
ESTACK_CHECK_SETUP
current_exception->throw_name = NULL;
discard_current_exception(); // uses IObuff if 'verbose'
suppress_errthrow = TRUE;
force_abort = TRUE;
if (messages != NULL)
{
do
{
msglist_T *next = messages->next;
int save_compiling = estack_compiling;
estack_compiling = messages->msg_compiling;
emsg(messages->msg);
vim_free(messages->msg);
vim_free(messages->sfile);
vim_free(messages);
messages = next;
estack_compiling = save_compiling;
}
while (messages != NULL);
}
else if (p != NULL)
{
emsg(p);
vim_free(p);
}
vim_free(SOURCING_NAME);
ESTACK_CHECK_NOW
estack_pop();
}
/*
* Obtain a line when inside a ":while" or ":for" loop.
*/

View File

@@ -1822,6 +1822,13 @@ get_expr_indent(void)
check_cursor();
State = save_State;
// Reset did_throw, unless 'debug' has "throw" and inside a try/catch.
if (did_throw && (vim_strchr(p_debug, 't') == NULL || trylevel == 0))
{
handle_did_throw();
did_throw = FALSE;
}
// If there is an error, just keep the current indent.
if (indent < 0)
indent = get_indent();

View File

@@ -3,6 +3,7 @@ void do_exmode(int improved);
int do_cmdline_cmd(char_u *cmd);
int do_cmd_argument(char_u *cmd);
int do_cmdline(char_u *cmdline, char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie, int flags);
void handle_did_throw(void);
int getline_equal(char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie, char_u *(*func)(int, void *, int, getline_opt_T));
void *getline_cookie(char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie);
char_u *getline_peek(char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie);

View File

@@ -1325,6 +1325,9 @@ func Test_Executable()
if catcmd =~ '\<sbin\>' && result =~ '\<bin\>'
call assert_equal('/' .. substitute(catcmd, '\<sbin\>', 'bin', ''), result)
else
" /bin/cat and /usr/bin/cat may be hard linked, we could get either
let result = substitute(result, '/usr/bin/cat', '/bin/cat', '')
let catcmd = substitute(catcmd, 'usr/bin/cat', 'bin/cat', '')
call assert_equal('/' .. catcmd, result)
endif
bwipe

View File

@@ -239,6 +239,9 @@ func Test_prop_find()
let result = prop_find({'type': 'prop_name', 'lnum': 1}, 'f')
call assert_equal(expected[0], result)
" When ID is -1 it's like prop is not found.
call assert_equal({}, prop_find({'id': -1}))
call prop_clear(1,6)
call prop_type_delete('prop_name')

View File

@@ -76,7 +76,7 @@ def Test_abs()
enddef
def Test_add()
CheckDefAndScriptFailure2(['add({}, 1)'], 'E1013: Argument 1: type mismatch, expected list<any> but got dict<unknown>', 'E1226: String or List required for argument 1')
CheckDefAndScriptFailure2(['add({}, 1)'], 'E1013: Argument 1: type mismatch, expected list<any> but got dict<unknown>', 'E1226: List or Blob required for argument 1')
CheckDefFailure(['add([1], "a")'], 'E1012: Type mismatch; expected number but got string')
enddef
@@ -198,7 +198,7 @@ def Test_appendbufline()
assert_equal(['zero'], getbufline(bnum, 1))
CheckDefAndScriptFailure2(['appendbufline([1], 1, "x")'], 'E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1')
CheckDefAndScriptFailure2(['appendbufline(1, [1], "x")'], 'E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 2')
CheckDefAndScriptFailure2(['appendbufline(1, 1, {"a": 10})'], 'E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String or List required for argument 3')
CheckDefAndScriptFailure2(['appendbufline(1, 1, {"a": 10})'], 'E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 3')
bnum->bufwinid()->win_gotoid()
bwipe!
enddef
@@ -628,7 +628,7 @@ def Test_complete()
enddef
def Test_complete_add()
CheckDefAndScriptFailure2(['complete_add([])'], 'E1013: Argument 1: type mismatch, expected string but got list<unknown>', 'E1223: String or List required for argument 1')
CheckDefAndScriptFailure2(['complete_add([])'], 'E1013: Argument 1: type mismatch, expected string but got list<unknown>', 'E1223: String or Dictionary required for argument 1')
enddef
def Test_complete_info()
@@ -673,7 +673,7 @@ enddef
def Test_count()
count('ABC ABC ABC', 'b', true)->assert_equal(3)
count('ABC ABC ABC', 'b', false)->assert_equal(0)
CheckDefAndScriptFailure2(['count(10, 1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1225: String or List required for argument 1')
CheckDefAndScriptFailure2(['count(10, 1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1225: String, List or Dictionary required for argument 1')
CheckDefAndScriptFailure2(['count("a", [1], 2)'], 'E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3')
CheckDefAndScriptFailure2(['count("a", [1], 0, "b")'], 'E1013: Argument 4: type mismatch, expected number but got string', 'E1210: Number required for argument 4')
count([1, 2, 2, 3], 2)->assert_equal(2)
@@ -703,7 +703,7 @@ def Test_cursor()
cursor('2', 1)
END
CheckDefExecAndScriptFailure(lines, 'E1209:')
CheckDefAndScriptFailure2(['cursor(0z10, 1)'], 'E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['cursor(0z10, 1)'], 'E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['cursor(1, "2")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
CheckDefAndScriptFailure2(['cursor(1, 2, "3")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
enddef
@@ -1072,7 +1072,7 @@ def Wrong_dict_key_type(items: list<number>): list<number>
enddef
def Test_filter()
CheckDefAndScriptFailure2(['filter(1.1, "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got float', 'E1228: List or Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['filter(1.1, "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got float', 'E1228: List, Dictionary or Blob required for argument 1')
assert_equal([], filter([1, 2, 3], '0'))
assert_equal([1, 2, 3], filter([1, 2, 3], '1'))
assert_equal({b: 20}, filter({a: 10, b: 20}, 'v:val == 20'))
@@ -1556,7 +1556,7 @@ enddef
def Test_index()
index(['a', 'b', 'a', 'B'], 'b', 2, true)->assert_equal(3)
CheckDefAndScriptFailure2(['index("a", "a")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: String or List required for argument 1')
CheckDefAndScriptFailure2(['index("a", "a")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1')
CheckDefFailure(['index(["1"], 1)'], 'E1013: Argument 2: type mismatch, expected string but got number')
CheckDefAndScriptFailure2(['index(0z10, "b")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
CheckDefAndScriptFailure2(['index([1], 1, "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
@@ -1629,7 +1629,7 @@ def Test_insert()
assert_equal(['a', 'b', 'c'], insert(['b', 'c'], 'a'))
assert_equal(0z1234, insert(0z34, 0x12))
CheckDefAndScriptFailure2(['insert("a", 1)'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: String or List required for argument 1')
CheckDefAndScriptFailure2(['insert("a", 1)'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1')
CheckDefFailure(['insert([2, 3], "a")'], 'E1013: Argument 2: type mismatch, expected number but got string')
CheckDefAndScriptFailure2(['insert([2, 3], 1, "x")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
enddef
@@ -1821,8 +1821,8 @@ def Test_lua()
enddef
def Test_map()
CheckDefAndScriptFailure2(['map("x", "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List or Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['map(1, "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1228: List or Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['map("x", "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List, Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['map(1, "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1228: List, Dictionary or Blob required for argument 1')
enddef
def Test_map_failure()
@@ -1935,8 +1935,8 @@ def Test_mapcheck()
enddef
def Test_mapnew()
CheckDefAndScriptFailure2(['mapnew("x", "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List or Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['mapnew(1, "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1228: List or Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['mapnew("x", "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List, Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['mapnew(1, "1")'], 'E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1228: List, Dictionary or Blob required for argument 1')
enddef
def Test_mapset()
@@ -2148,7 +2148,7 @@ def Test_perleval()
enddef
def Test_popup_atcursor()
CheckDefAndScriptFailure2(['popup_atcursor({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['popup_atcursor({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['popup_atcursor("a", [1, 2])'], 'E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2')
# Pass variable of type 'any' to popup_atcursor()
@@ -2159,7 +2159,7 @@ def Test_popup_atcursor()
enddef
def Test_popup_beval()
CheckDefAndScriptFailure2(['popup_beval({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['popup_beval({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['popup_beval("a", [1, 2])'], 'E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2')
enddef
@@ -2181,7 +2181,7 @@ def Test_popup_create()
enddef
def Test_popup_dialog()
CheckDefAndScriptFailure2(['popup_dialog({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['popup_dialog({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['popup_dialog("a", [1, 2])'], 'E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2')
enddef
@@ -2216,7 +2216,7 @@ def Test_popup_locate()
enddef
def Test_popup_menu()
CheckDefAndScriptFailure2(['popup_menu({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['popup_menu({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['popup_menu("a", [1, 2])'], 'E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2')
enddef
@@ -2226,7 +2226,7 @@ def Test_popup_move()
enddef
def Test_popup_notification()
CheckDefAndScriptFailure2(['popup_notification({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['popup_notification({"a": 10}, {})'], 'E1013: Argument 1: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['popup_notification("a", [1, 2])'], 'E1013: Argument 2: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 2')
enddef
@@ -2517,7 +2517,7 @@ def Test_remove_const_list()
enddef
def Test_remove()
CheckDefAndScriptFailure2(['remove("a", 1)'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List or Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['remove("a", 1)'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1228: List, Dictionary or Blob required for argument 1')
CheckDefAndScriptFailure2(['remove([], "b")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
CheckDefAndScriptFailure2(['remove([], 1, "c")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
CheckDefAndScriptFailure2(['remove({}, 1.1)'], 'E1013: Argument 2: type mismatch, expected string but got float', 'E1220: String or Number required for argument 2')
@@ -2556,8 +2556,8 @@ def Test_rename()
enddef
def Test_repeat()
CheckDefAndScriptFailure2(['repeat(1.1, 2)'], 'E1013: Argument 1: type mismatch, expected string but got float', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['repeat({a: 10}, 2)'], 'E1013: Argument 1: type mismatch, expected string but got dict<', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['repeat(1.1, 2)'], 'E1013: Argument 1: type mismatch, expected string but got float', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['repeat({a: 10}, 2)'], 'E1013: Argument 1: type mismatch, expected string but got dict<', 'E1224: String, Number or List required for argument 1')
assert_equal('aaa', repeat('a', 3))
assert_equal('111', repeat(1, 3))
assert_equal([1, 1, 1], repeat([1], 3))
@@ -2569,8 +2569,8 @@ def Test_resolve()
enddef
def Test_reverse()
CheckDefAndScriptFailure2(['reverse(10)'], 'E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1226: String or List required for argument 1')
CheckDefAndScriptFailure2(['reverse("abc")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: String or List required for argument 1')
CheckDefAndScriptFailure2(['reverse(10)'], 'E1013: Argument 1: type mismatch, expected list<any> but got number', 'E1226: List or Blob required for argument 1')
CheckDefAndScriptFailure2(['reverse("abc")'], 'E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1')
enddef
def Test_reverse_return_type()
@@ -2830,7 +2830,7 @@ def Test_setbufline()
assert_equal(['1', '2', '3', 'one', '10', 'two', '11'], getbufline(bnum, 1, '$'))
CheckDefAndScriptFailure2(['setbufline([1], 1, "x")'], 'E1013: Argument 1: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 1')
CheckDefAndScriptFailure2(['setbufline(1, [1], "x")'], 'E1013: Argument 2: type mismatch, expected string but got list<number>', 'E1220: String or Number required for argument 2')
CheckDefAndScriptFailure2(['setbufline(1, 1, {"a": 10})'], 'E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String or List required for argument 3')
CheckDefAndScriptFailure2(['setbufline(1, 1, {"a": 10})'], 'E1013: Argument 3: type mismatch, expected string but got dict<number>', 'E1224: String, Number or List required for argument 3')
bnum->bufwinid()->win_gotoid()
bw!
enddef
@@ -2859,7 +2859,7 @@ def Test_setcmdpos()
enddef
def Test_setcursorcharpos()
CheckDefAndScriptFailure2(['setcursorcharpos(0z10, 1)'], 'E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String or List required for argument 1')
CheckDefAndScriptFailure2(['setcursorcharpos(0z10, 1)'], 'E1013: Argument 1: type mismatch, expected number but got blob', 'E1224: String, Number or List required for argument 1')
CheckDefAndScriptFailure2(['setcursorcharpos(1, "2")'], 'E1013: Argument 2: type mismatch, expected number but got string', 'E1210: Number required for argument 2')
CheckDefAndScriptFailure2(['setcursorcharpos(1, 2, "3")'], 'E1013: Argument 3: type mismatch, expected number but got string', 'E1210: Number required for argument 3')
enddef
@@ -3289,13 +3289,13 @@ enddef
def Test_system()
CheckDefAndScriptFailure2(['system(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
CheckDefAndScriptFailure2(['system("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1224: String or List required for argument 2')
CheckDefAndScriptFailure2(['system("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1224: String, Number or List required for argument 2')
assert_equal("123\n", system('echo 123'))
enddef
def Test_systemlist()
CheckDefAndScriptFailure2(['systemlist(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
CheckDefAndScriptFailure2(['systemlist("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1224: String or List required for argument 2')
CheckDefAndScriptFailure2(['systemlist("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1224: String, Number or List required for argument 2')
if has('win32')
call assert_equal(["123\r"], systemlist('echo 123'))
else

View File

@@ -686,7 +686,11 @@ f_prop_find(typval_T *argvars, typval_T *rettv)
skipstart = dict_get_bool(dict, (char_u *)"skipstart", 0);
if (dict_find(dict, (char_u *)"id", -1) != NULL)
{
id = dict_get_number(dict, (char_u *)"id");
if (id == -1)
id = -2;
}
if (dict_find(dict, (char_u *)"type", -1))
{
char_u *name = dict_get_string(dict, (char_u *)"type", FALSE);

View File

@@ -718,7 +718,7 @@ check_for_string_or_number_or_list_arg(typval_T *args, int idx)
&& args[idx].v_type != VAR_LIST)
{
if (idx >= 0)
semsg(_(e_string_or_number_or_list_required_for_argument_nr), idx + 1);
semsg(_(e_string_number_or_list_required_for_argument_nr), idx + 1);
else
emsg(_(e_stringreq));
return FAIL;
@@ -749,7 +749,7 @@ check_for_string_or_list_or_dict_arg(typval_T *args, int idx)
&& args[idx].v_type != VAR_DICT)
{
if (idx >= 0)
semsg(_(e_string_or_list_or_dict_required_for_argument_nr), idx + 1);
semsg(_(e_string_list_or_dict_required_for_argument_nr), idx + 1);
else
emsg(_(e_stringreq));
return FAIL;
@@ -804,7 +804,7 @@ check_for_list_or_dict_or_blob_arg(typval_T *args, int idx)
&& args[idx].v_type != VAR_BLOB)
{
if (idx >= 0)
semsg(_(e_list_or_dict_or_blob_required_for_argument_nr), idx + 1);
semsg(_(e_list_dict_or_blob_required_for_argument_nr), idx + 1);
else
emsg(_(e_listreq));
return FAIL;

View File

@@ -755,6 +755,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3260,
/**/
3259,
/**/
3258,
/**/
3257,
/**/
3256,
/**/
3255,
/**/