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.
diff --git a/src/message.c b/src/message.c
index 38e6959..a9851ef 100644
--- a/src/message.c
+++ b/src/message.c
@@ -658,6 +658,9 @@
{
emsg_assert_fails_msg = vim_strsave(s);
emsg_assert_fails_lnum = SOURCING_LNUM;
+ vim_free(emsg_assert_fails_context);
+ emsg_assert_fails_context = vim_strsave(
+ SOURCING_NAME == NULL ? (char_u *)"" : SOURCING_NAME);
}
// set "v:errmsg", also when using ":silent! cmd"