diff src/testdir/test_user_func.vim @ 32262:854aeaac48b7 v9.0.1462

patch 9.0.1462: recursively calling :defer function if it does :qa Commit: https://github.com/vim/vim/commit/42994bf678f46dc9ca66e49f512261da8864fff6 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 17 19:23:45 2023 +0100 patch 9.0.1462: recursively calling :defer function if it does :qa Problem: Recursively calling :defer function if it does :qa. Solution: Clear the defer entry before calling the function. (closes https://github.com/vim/vim/issues/12266)
author Bram Moolenaar <Bram@vim.org>
date Mon, 17 Apr 2023 20:30:07 +0200
parents aa45593ec2ca
children 83caf07aedd6
line wrap: on
line diff
--- a/src/testdir/test_user_func.vim
+++ b/src/testdir/test_user_func.vim
@@ -656,6 +656,7 @@ func Test_defer_quitall()
       vim9script
       func DeferLevelTwo()
         call writefile(['text'], 'XQuitallTwo', 'D')
+        call writefile(['quit'], 'XQuitallThree', 'a')
         qa!
       endfunc
 
@@ -671,6 +672,9 @@ func Test_defer_quitall()
   call assert_equal(0, v:shell_error)
   call assert_false(filereadable('XQuitallOne'))
   call assert_false(filereadable('XQuitallTwo'))
+  call assert_equal(['quit'], readfile('XQuitallThree'))
+
+  call delete('XQuitallThree')
 endfunc
 
 func Test_defer_quitall_in_expr_func()