Mercurial > vim
annotate src/testdir/test_exit.vim @ 22715:8968ed4ba4ba v8.2.1906
patch 8.2.1906: warning for signed/unsigned
Commit: https://github.com/vim/vim/commit/a360dbe3b63bdca93bbf8cc431578a446e8ce14c
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 26 18:46:53 2020 +0100
patch 8.2.1906: warning for signed/unsigned
Problem: Warning for signed/unsigned.
Solution: Use size_t instead of int. (Mike Williams)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 26 Oct 2020 19:00:04 +0100 |
parents | 08940efa6b4e |
children | ad674a98058a |
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() |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
6 let after =<< trim [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
7 au QuitPre * call writefile(["QuitPre"], "Xtestout") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
8 au ExitPre * call writefile(["ExitPre"], "Xtestout", "a") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
9 quit |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
10 [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
11 |
13442
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 if RunVim([], after, '') |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 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
|
14 endif |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call delete('Xtestout') |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
17 let after =<< trim [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
18 au QuitPre * call writefile(["QuitPre"], "Xtestout") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
19 au ExitPre * call writefile(["ExitPre"], "Xtestout", "a") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
20 help |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
21 wincmd w |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
22 quit |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
23 [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
24 |
13442
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 if RunVim([], after, '') |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 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
|
27 endif |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call delete('Xtestout') |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
30 let after =<< trim [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
31 au QuitPre * call writefile(["QuitPre"], "Xtestout") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
32 au ExitPre * call writefile(["ExitPre"], "Xtestout", "a") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
33 split |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
34 new |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
35 qall |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
36 [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
37 |
13442
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 if RunVim([], after, '') |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 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
|
40 endif |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call delete('Xtestout') |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 |
18406
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
43 " ExitPre autocommand splits the window, so that it's no longer the last one. |
16720
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
44 let after =<< trim [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
45 au QuitPre * call writefile(["QuitPre"], "Xtestout", "a") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
46 au ExitPre * call writefile(["ExitPre"], "Xtestout", "a") |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
47 augroup nasty |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
48 au ExitPre * split |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
49 augroup END |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
50 quit |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
51 augroup nasty |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
52 au! ExitPre |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
53 augroup END |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
54 quit |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
55 [CODE] |
9c90cf08cfa8
patch 8.1.1362: code and data in tests can be hard to read
Bram Moolenaar <Bram@vim.org>
parents:
13442
diff
changeset
|
56 |
13442
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 if RunVim([], after, '') |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 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
|
59 \ readfile('Xtestout')) |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 endif |
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 call delete('Xtestout') |
18406
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
62 |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
63 " ExitPre autocommand splits and closes the window, so that there is still |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
64 " one window but it's a different one. |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
65 let after =<< trim [CODE] |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
66 au QuitPre * call writefile(["QuitPre"], "Xtestout", "a") |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
67 au ExitPre * call writefile(["ExitPre"], "Xtestout", "a") |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
68 augroup nasty |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
69 au ExitPre * split | only |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
70 augroup END |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
71 quit |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
72 augroup nasty |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
73 au! ExitPre |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
74 augroup END |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
75 quit |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
76 [CODE] |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
77 |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
78 if RunVim([], after, '') |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
79 call assert_equal(['QuitPre', 'ExitPre', 'QuitPre', 'ExitPre'], |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
80 \ readfile('Xtestout')) |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
81 endif |
fa6efc49d71f
patch 8.1.2197: ExitPre autocommand may cause accessing freed memory
Bram Moolenaar <Bram@vim.org>
parents:
16720
diff
changeset
|
82 call delete('Xtestout') |
13442
94e638936d3e
patch 8.0.1595: no autocommand triggered before exiting
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18406
diff
changeset
|
84 |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
18406
diff
changeset
|
85 " vim: shiftwidth=2 sts=2 expandtab |