From 8b0c5de4e0964109326a0befb1b3bff6aac4d0db Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 5 Nov 2022 07:24:06 +0800 Subject: vim-patch:partial:8.2.1183: assert_fails() checks the last error message Problem: assert_fails() checks the last error message. Solution: Check the first error, it is more relevant. Fix all the tests that rely on the old behavior. https://github.com/vim/vim/commit/9b7bf9e98f06ece595fed7a3ff53ecce89797a53 Skip test_listener.vim, test_textprop.vim, test_viminfo.vim. Skip test_python2.vim: affected line fails and hasn't been ported. Skip test_python3.vim: affected lines fail and haven't been ported. Skip CHECK_LIST_MATERIALIZE. Co-authored-by: Bram Moolenaar --- src/nvim/message.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index b608b59c9b..4837f4131a 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -663,6 +663,10 @@ static bool emsg_multiline(const char *s, bool multiline) return true; } + if (emsg_assert_fails_used && emsg_assert_fails_msg == NULL) { + emsg_assert_fails_msg = xstrdup(s); + } + // set "v:errmsg", also when using ":silent! cmd" set_vim_var_string(VV_ERRMSG, s, -1); -- cgit From 0d8293364f78237afb83d4822611d6fd8add66f8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 5 Nov 2022 12:37:28 +0800 Subject: vim-patch:8.2.1479: Vim9: error for list index uses wrong line number Problem: Vim9: error for list index uses wrong line number. Solution: Set source line number. (closes vim/vim#6724) Add a way to assert the line number of the error with assert_fails(). https://github.com/vim/vim/commit/1d634542cf5ebcd1d5d83bd124b3e1d5e7c96c58 Co-authored-by: Bram Moolenaar --- src/nvim/message.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index 4837f4131a..c95968afb4 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -665,6 +665,7 @@ static bool emsg_multiline(const char *s, bool multiline) if (emsg_assert_fails_used && emsg_assert_fails_msg == NULL) { emsg_assert_fails_msg = xstrdup(s); + emsg_assert_fails_lnum = SOURCING_LNUM; } // set "v:errmsg", also when using ":silent! cmd" -- cgit From 02f80d9a8a560a93142bcebf324ba14cde4dd1b5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 5 Nov 2022 12:41:36 +0800 Subject: vim-patch:8.2.1631: test_fails() does not check the context of the line number Problem: test_fails() does not check the context of the line number. Solution: Use another argument to specify the context of the line number. https://github.com/vim/vim/commit/9bd5d879c2ecfbdbb168b090e12f4b89724a302e Co-authored-by: Bram Moolenaar --- src/nvim/message.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index c95968afb4..fa1c8036e6 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -666,6 +666,8 @@ static bool emsg_multiline(const char *s, bool multiline) if (emsg_assert_fails_used && emsg_assert_fails_msg == NULL) { emsg_assert_fails_msg = xstrdup(s); emsg_assert_fails_lnum = SOURCING_LNUM; + xfree(emsg_assert_fails_context); + emsg_assert_fails_context = xstrdup(SOURCING_NAME == NULL ? "" : SOURCING_NAME); } // set "v:errmsg", also when using ":silent! cmd" -- cgit