comparison src/testdir/test_exit.vim @ 13442:94e638936d3e v8.0.1595

patch 8.0.1595: no autocommand triggered before exiting commit https://github.com/vim/vim/commit/12a96de430779b88795fac87a2be666d9f661d1e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 11 14:44:18 2018 +0100 patch 8.0.1595: no autocommand triggered before exiting Problem: No autocommand triggered before exiting. Solution: Add the ExitPre autocommand event.
author Christian Brabandt <cb@256bit.org>
date Sun, 11 Mar 2018 14:45:05 +0100
parents
children 9c90cf08cfa8
comparison
equal deleted inserted replaced
13441:16773ccde7fe 13442:94e638936d3e
1 " Tests for exiting Vim.
2
3 source shared.vim
4
5 func Test_exiting()
6 let after = [
7 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
8 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
9 \ 'quit',
10 \ ]
11 if RunVim([], after, '')
12 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
13 endif
14 call delete('Xtestout')
15
16 let after = [
17 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
18 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
19 \ 'help',
20 \ 'wincmd w',
21 \ 'quit',
22 \ ]
23 if RunVim([], after, '')
24 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
25 endif
26 call delete('Xtestout')
27
28 let after = [
29 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
30 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
31 \ 'split',
32 \ 'new',
33 \ 'qall',
34 \ ]
35 if RunVim([], after, '')
36 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
37 endif
38 call delete('Xtestout')
39
40 let after = [
41 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout", "a")',
42 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
43 \ 'augroup nasty',
44 \ ' au ExitPre * split',
45 \ 'augroup END',
46 \ 'quit',
47 \ 'augroup nasty',
48 \ ' au! ExitPre',
49 \ 'augroup END',
50 \ 'quit',
51 \ ]
52 if RunVim([], after, '')
53 call assert_equal(['QuitPre', 'ExitPre', 'QuitPre', 'ExitPre'],
54 \ readfile('Xtestout'))
55 endif
56 call delete('Xtestout')
57 endfunc