From 8ba7a966a1339767b19a5ca4449b38ef0cae49c7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 5 Nov 2022 12:40:46 +0800 Subject: vim-patch:8.2.1484: flaky failure in assert_fails() Problem: Flaky failure in assert_fails(). Solution: Only used fourth argument if there is a third argument. https://github.com/vim/vim/commit/9b02d64cff7664b9643205d6e23b08da688fe87a Co-authored-by: Bram Moolenaar --- src/nvim/testing.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testing.c b/src/nvim/testing.c index 7651122cce..4ab1367f26 100644 --- a/src/nvim/testing.c +++ b/src/nvim/testing.c @@ -529,7 +529,8 @@ void f_assert_fails(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) goto theend; } - if (!error_found && argvars[3].v_type == VAR_NUMBER + if (!error_found && argvars[2].v_type != VAR_UNKNOWN + && argvars[3].v_type == VAR_NUMBER && argvars[3].vval.v_number >= 0 && argvars[3].vval.v_number != emsg_assert_fails_lnum) { error_found = true; -- cgit