Mercurial > vim
annotate src/testdir/test_filechanged.vim @ 34644:9b94748e226a
runtime(java): Update java[CR]_JavaLang type lists (#14297)
Commit: https://github.com/vim/vim/commit/63d68c2c218eeb80c164e1c56c53f51a9e92a5eb
Author: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Date: Tue Mar 26 20:12:05 2024 +0300
runtime(java): Update java[CR]_JavaLang type lists (https://github.com/vim/vim/issues/14297)
- Add to the list of java.lang runtime exceptions two new
types: MatchException (Pattern Matching for _switch_) and
WrongThreadException (Virtual Threads).
- "Demote" Compiler (removed in JDK 21) from the list of
java.lang class types to a new list javaLangDeprecated.
References:
https://bugs.openjdk.org/browse/JDK-8205129
https://bugs.openjdk.org/browse/JDK-8282274
https://bugs.openjdk.org/browse/JDK-8284161
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 26 Mar 2024 18:15:08 +0100 |
parents | a7a9e8b9af89 |
children | 49637bd5c863 |
rev | line source |
---|---|
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " Tests for when a file was changed outside of Vim. |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
16754
diff
changeset
|
3 source check.vim |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
16754
diff
changeset
|
4 |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 func Test_FileChangedShell_reload() |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
16754
diff
changeset
|
6 CheckUnix |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
16754
diff
changeset
|
7 |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 augroup testreload |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'reload' |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 augroup END |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 new Xchanged_r |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 call setline(1, 'reload this') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 write |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 " Need to wait until the timestamp would change by at least a second. |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 sleep 2 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 silent !echo 'extra line' >>Xchanged_r |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 call assert_equal('changed', g:reason) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 call assert_equal(2, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 call assert_equal('extra line', getline(2)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 " Only triggers once |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
23 let g:reason = '' |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
24 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 call assert_equal('', g:reason) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
27 " When deleted buffer is not reloaded |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
28 silent !rm Xchanged_r |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
29 let g:reason = '' |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
30 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
31 call assert_equal('deleted', g:reason) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 call assert_equal(2, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 call assert_equal('extra line', getline(2)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 " When recreated buffer is reloaded |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 call setline(1, 'buffer is changed') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 silent !echo 'new line' >>Xchanged_r |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 let g:reason = '' |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 call assert_equal('conflict', g:reason) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 call assert_equal(1, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 call assert_equal('new line', getline(1)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 " Only mode changed |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 silent !chmod +x Xchanged_r |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 let g:reason = '' |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
47 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
48 call assert_equal('mode', g:reason) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 call assert_equal(1, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 call assert_equal('new line', getline(1)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 " Only time changed |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 sleep 2 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 silent !touch Xchanged_r |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 let g:reason = '' |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 call assert_equal('time', g:reason) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
58 call assert_equal(1, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
59 call assert_equal('new line', getline(1)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
60 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 if has('persistent_undo') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 " With an undo file the reload can be undone and a change before the |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 " reload. |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 set undofile |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 call setline(2, 'before write') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 write |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 call setline(2, 'after write') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 sleep 2 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 silent !echo 'different line' >>Xchanged_r |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 let g:reason = '' |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 call assert_equal('conflict', g:reason) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 call assert_equal(3, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 call assert_equal('before write', getline(2)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 call assert_equal('different line', getline(3)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
76 " undo the reload |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 undo |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 call assert_equal(2, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 call assert_equal('after write', getline(2)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 " undo the change before reload |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 undo |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 call assert_equal(2, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
83 call assert_equal('before write', getline(2)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
85 set noundofile |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
86 endif |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
87 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
88 au! testreload |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 bwipe! |
16358
1a441c73adbc
patch 8.1.1184: undo file left behind after running test
Bram Moolenaar <Bram@vim.org>
parents:
15625
diff
changeset
|
90 call delete(undofile('Xchanged_r')) |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 call delete('Xchanged_r') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
92 endfunc |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 |
27635
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
94 func Test_FileChangedShell_edit() |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
95 CheckUnix |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
96 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
97 new Xchanged_r |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
98 call setline(1, 'reload this') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
99 set fileformat=unix |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
100 write |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
101 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
102 " File format changed, reload (content only, no 'ff' etc) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
103 augroup testreload |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
104 au! |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
105 au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'reload' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
106 augroup END |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
107 call assert_equal(&fileformat, 'unix') |
30552
a7a9e8b9af89
patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
108 call writefile(["line1\r", "line2\r"], 'Xchanged_r', 'D') |
27635
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
109 let g:reason = '' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
110 checktime |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
111 call assert_equal('changed', g:reason) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
112 call assert_equal(&fileformat, 'unix') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
113 call assert_equal("line1\r", getline(1)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
114 call assert_equal("line2\r", getline(2)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
115 %s/\r |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
116 write |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
117 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
118 " File format changed, reload with 'ff', etc |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
119 augroup testreload |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
120 au! |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
121 au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'edit' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
122 augroup END |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
123 call assert_equal(&fileformat, 'unix') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
124 call writefile(["line1\r", "line2\r"], 'Xchanged_r') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
125 let g:reason = '' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
126 checktime |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
127 call assert_equal('changed', g:reason) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
128 call assert_equal(&fileformat, 'dos') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
129 call assert_equal('line1', getline(1)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
130 call assert_equal('line2', getline(2)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
131 set fileformat=unix |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
132 write |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
133 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
134 au! testreload |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
135 bwipe! |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
136 call delete(undofile('Xchanged_r')) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
137 endfunc |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
138 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
139 func Test_FileChangedShell_edit_dialog() |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
140 CheckNotGui |
28247
f70015784777
patch 8.2.4649: various formatting problems
Bram Moolenaar <Bram@vim.org>
parents:
27647
diff
changeset
|
141 CheckUnix " Using low level feedkeys() does not work on MS-Windows. |
27635
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
142 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
143 new Xchanged_r |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
144 call setline(1, 'reload this') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
145 set fileformat=unix |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
146 write |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
147 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
148 " File format changed, reload (content only) via prompt |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
149 augroup testreload |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
150 au! |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
151 au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'ask' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
152 augroup END |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
153 call assert_equal(&fileformat, 'unix') |
30552
a7a9e8b9af89
patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
154 call writefile(["line1\r", "line2\r"], 'Xchanged_r', 'D') |
27635
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
155 let g:reason = '' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
156 call feedkeys('L', 'L') " load file content only |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
157 checktime |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
158 call assert_equal('changed', g:reason) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
159 call assert_equal(&fileformat, 'unix') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
160 call assert_equal("line1\r", getline(1)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
161 call assert_equal("line2\r", getline(2)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
162 %s/\r |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
163 write |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
164 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
165 " File format changed, reload (file and options) via prompt |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
166 augroup testreload |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
167 au! |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
168 au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'ask' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
169 augroup END |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
170 call assert_equal(&fileformat, 'unix') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
171 call writefile(["line1\r", "line2\r"], 'Xchanged_r') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
172 let g:reason = '' |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
173 call feedkeys('a', 'L') " load file content and options |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
174 checktime |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
175 call assert_equal('changed', g:reason) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
176 call assert_equal(&fileformat, 'dos') |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
177 call assert_equal("line1", getline(1)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
178 call assert_equal("line2", getline(2)) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
179 set fileformat=unix |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
180 write |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
181 |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
182 au! testreload |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
183 bwipe! |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
184 call delete(undofile('Xchanged_r')) |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
185 endfunc |
6ca2d8f4cd32
patch 8.2.4343: when reloading not all properties are detected
Bram Moolenaar <Bram@vim.org>
parents:
20861
diff
changeset
|
186 |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
187 func Test_file_changed_dialog() |
17657
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
16754
diff
changeset
|
188 CheckUnix |
0da9bc55c31a
patch 8.1.1826: tests use hand coded feature and option checks
Bram Moolenaar <Bram@vim.org>
parents:
16754
diff
changeset
|
189 CheckNotGui |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
190 au! FileChangedShell |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
191 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
192 new Xchanged_d |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
193 call setline(1, 'reload this') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
194 write |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
195 " Need to wait until the timestamp would change by at least a second. |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
196 sleep 2 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
197 silent !echo 'extra line' >>Xchanged_d |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
198 call feedkeys('L', 'L') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
199 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
200 call assert_match('W11:', v:warningmsg) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
201 call assert_equal(2, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
202 call assert_equal('reload this', getline(1)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
203 call assert_equal('extra line', getline(2)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
204 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
205 " delete buffer, only shows an error, no prompt |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
206 silent !rm Xchanged_d |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
207 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
208 call assert_match('E211:', v:warningmsg) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
209 call assert_equal(2, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
210 call assert_equal('extra line', getline(2)) |
16754
8b92f3fea477
patch 8.1.1379: filechanged test hangs
Bram Moolenaar <Bram@vim.org>
parents:
16358
diff
changeset
|
211 let v:warningmsg = 'empty' |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
212 |
16754
8b92f3fea477
patch 8.1.1379: filechanged test hangs
Bram Moolenaar <Bram@vim.org>
parents:
16358
diff
changeset
|
213 " change buffer, recreate the file and reload |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
214 call setline(1, 'buffer is changed') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
215 silent !echo 'new line' >Xchanged_d |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
216 call feedkeys('L', 'L') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
217 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
218 call assert_match('W12:', v:warningmsg) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
219 call assert_equal(1, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
220 call assert_equal('new line', getline(1)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
221 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
222 " Only mode changed, reload |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
223 silent !chmod +x Xchanged_d |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
224 call feedkeys('L', 'L') |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
225 checktime |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
226 call assert_match('W16:', v:warningmsg) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
227 call assert_equal(1, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
228 call assert_equal('new line', getline(1)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
229 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
230 " Only time changed, no prompt |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
231 sleep 2 |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
232 silent !touch Xchanged_d |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
233 let v:warningmsg = '' |
19289
2f0f308c069c
patch 8.2.0203: :helptags and some other functionality not tested
Bram Moolenaar <Bram@vim.org>
parents:
17657
diff
changeset
|
234 checktime Xchanged_d |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
235 call assert_equal('', v:warningmsg) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
236 call assert_equal(1, line('$')) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
237 call assert_equal('new line', getline(1)) |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
238 |
20861
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
239 " File created after starting to edit it |
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
240 call delete('Xchanged_d') |
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
241 new Xchanged_d |
30552
a7a9e8b9af89
patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
242 call writefile(['one'], 'Xchanged_d', 'D') |
20861
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
243 call feedkeys('L', 'L') |
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
244 checktime Xchanged_d |
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
245 call assert_equal(['one'], getline(1, '$')) |
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
246 close! |
1725bb56178a
patch 8.2.0982: insufficient testing for reading/writing files
Bram Moolenaar <Bram@vim.org>
parents:
19407
diff
changeset
|
247 |
15615
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
248 bwipe! |
536fca2cee19
patch 8.1.0815: dialog for file changed outside of Vim not tested
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
249 endfunc |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
250 |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
251 " Test for editing a new buffer from a FileChangedShell autocmd |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
252 func Test_FileChangedShell_newbuf() |
30552
a7a9e8b9af89
patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
253 call writefile(['one', 'two'], 'Xchfile', 'D') |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
28247
diff
changeset
|
254 new Xchfile |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
255 augroup testnewbuf |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
256 autocmd FileChangedShell * enew |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
257 augroup END |
30051
13b02c1ea0f7
patch 9.0.0363: common names in test files causes tests to be flaky
Bram Moolenaar <Bram@vim.org>
parents:
28247
diff
changeset
|
258 call writefile(['red'], 'Xchfile') |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
259 call assert_fails('checktime', 'E811:') |
30552
a7a9e8b9af89
patch 9.0.0611: tests delete files with a separate delete() call
Bram Moolenaar <Bram@vim.org>
parents:
30051
diff
changeset
|
260 |
19407
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
261 au! testnewbuf |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
262 endfunc |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
263 |
2f4be7ca1b1b
patch 8.2.0261: some code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
19289
diff
changeset
|
264 " vim: shiftwidth=2 sts=2 expandtab |