annotate src/testdir/test_exit.vim @ 14949:490af8a75db7

Added tag v8.1.0485 for changeset cb07193c6257b9ce72465d8c7e506fc3b3291091
author Bram Moolenaar <Bram@vim.org>
date Fri, 19 Oct 2018 17:00:07 +0200
parents 94e638936d3e
children 9c90cf08cfa8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13442
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for exiting Vim.
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 source shared.vim
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 func Test_exiting()
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ 'help',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ 'wincmd w',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ 'split',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 \ 'new',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 \ 'qall',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 call assert_equal(['QuitPre', 'ExitPre'], readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 let after = [
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 \ 'au QuitPre * call writefile(["QuitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 \ 'au ExitPre * call writefile(["ExitPre"], "Xtestout", "a")',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 \ 'augroup nasty',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 \ ' au ExitPre * split',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 \ 'augroup END',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 \ 'augroup nasty',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 \ ' au! ExitPre',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 \ 'augroup END',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 \ 'quit',
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 \ ]
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 if RunVim([], after, '')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 call assert_equal(['QuitPre', 'ExitPre', 'QuitPre', 'ExitPre'],
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 \ readfile('Xtestout'))
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 endif
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 call delete('Xtestout')
94e638936d3e patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 endfunc