endtry
call assert_match("E1222: String or List required for argument 2", exp)
+ try
+ call assert_equal(0, assert_fails('xxx', [#{one: 1}]))
+ catch
+ let exp = v:exception
+ endtry
+ call assert_match("E731: Using a Dictionary as a String", exp)
+
+ let exp = ''
+ try
+ call assert_equal(0, assert_fails('xxx', ['E492', #{one: 1}]))
+ catch
+ let exp = v:exception
+ endtry
+ call assert_match("E731: Using a Dictionary as a String", exp)
+
try
call assert_equal(1, assert_fails('xxx', 'E492', '', 'burp'))
catch
endtry
call assert_match("E1174: String required for argument 5", exp)
- call assert_equal(1, assert_fails('c0', ['', '\1']))
- call assert_match("Expected '\\\\\\\\1' but got 'E939: Positive count required: c0': c0", v:errors[0])
+ call assert_equal(1, assert_fails('c0', ['', '\(.\)\1']))
+ call assert_match("Expected '\\\\\\\\(.\\\\\\\\)\\\\\\\\1' but got 'E939: Positive count required: c0': c0", v:errors[0])
call remove(v:errors, 0)
endfunc
in_assert_fails = TRUE;
do_cmdline_cmd(cmd);
+
+ // reset here for any errors reported below
+ trylevel = save_trylevel;
+ suppress_errthrow = FALSE;
+
if (called_emsg == called_emsg_before)
{
prepare_assert_error(&ga);
CHECK_LIST_MATERIALIZE(list);
tv = &list->lv_first->li_tv;
expected = tv_get_string_buf_chk(tv, buf);
+ if (expected == NULL)
+ goto theend;
if (!pattern_match(expected, actual, FALSE))
{
error_found = TRUE;
{
tv = &list->lv_u.mat.lv_last->li_tv;
expected = tv_get_string_buf_chk(tv, buf);
+ if (expected == NULL)
+ goto theend;
if (!pattern_match(expected, actual, FALSE))
{
error_found = TRUE;