patch 8.2.1919: assert_fails() setting emsg_silent changes normal execution
Problem: Assert_fails() setting emsg_silent changes normal execution.
Solution: Use a separate flag in_assert_fails.
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 919af74..4ec0f6f 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1467,14 +1467,14 @@
g:did_it = 'yes'
enddef
-"func UserError()
-" silent! invalid
-"endfunc
-"
-"def SilentlyUserError()
-" UserError()
-" g:did_it = 'yes'
-"enddef
+func UserError()
+ silent! invalid
+endfunc
+
+def SilentlyUserError()
+ UserError()
+ g:did_it = 'yes'
+enddef
" This can't be a :def function, because the assert would not be reached.
" And this must not be inside a try/endtry.
@@ -1483,10 +1483,9 @@
call SilentlyError()
call assert_equal('yes', g:did_it)
-" this doesn't work yet
-" let g:did_it = 'no'
-" call SilentlyUserError()
-" call assert_equal('yes', g:did_it)
+ let g:did_it = 'no'
+ call SilentlyUserError()
+ call assert_equal('yes', g:did_it)
unlet g:did_it
endfunc