annotate src/testdir/test_autochdir.vim @ 26422:4397cc04f2b1 v8.2.3742

patch 8.2.3742: dec mouse test fails without gnome terminfo entry Commit: https://github.com/vim/vim/commit/f589fd3e1047cdf90566b68aaf9a13389e54d26a Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Sun Dec 5 12:39:21 2021 +0000 patch 8.2.3742: dec mouse test fails without gnome terminfo entry Problem: Dec mouse test fails without gnome terminfo entry. Solution: Check if there is a gnome entry. Also fix 'acd' test on MS-Windows. (Dominique Pell?, closes #9282)
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Dec 2021 13:45:03 +0100
parents 7606d9b13068
children 013de2ce0e30
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9469
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test 'autochdir' behavior
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.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: 16951
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: 16951
diff changeset
4 CheckOption autochdir
9469
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 func Test_set_filename()
12692
03a6aeea2096 patch 8.0.1224: still interference between test functions
Christian Brabandt <cb@256bit.org>
parents: 9469
diff changeset
7 let cwd = getcwd()
9469
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call test_autochdir()
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 set acd
15184
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
10
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
11 let s:li = []
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
12 autocmd DirChanged auto call add(s:li, "autocd")
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
13 autocmd DirChanged auto call add(s:li, expand("<afile>"))
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
14
9469
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 new
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 w samples/Xtest
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call assert_equal("Xtest", expand('%'))
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call assert_equal("samples", substitute(getcwd(), '.*/\(\k*\)', '\1', ''))
15184
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
19 call assert_equal(["autocd", getcwd()], s:li)
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
20
9469
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 bwipe!
15184
90ab2d3ce11d patch 8.1.0602: DirChanged is also triggered when directory didn't change
Bram Moolenaar <Bram@vim.org>
parents: 12692
diff changeset
22 au! DirChanged
9469
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 set noacd
18568
26a04a556982 patch 8.1.2278: using "cd" with "exe" may fail
Bram Moolenaar <Bram@vim.org>
parents: 17657
diff changeset
24 call chdir(cwd)
9469
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call delete('samples/Xtest')
38e2fc4ee4ef commit https://github.com/vim/vim/commit/5c71994f4ee5f87d4cce990dbc9684c70b1e108b
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 endfunc
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18568
diff changeset
27
26416
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
28 func Test_set_filename_other_window()
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
29 call ch_logfile('logfile', 'w')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
30 let cwd = getcwd()
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
31 call test_autochdir()
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
32 call mkdir('Xa')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
33 call mkdir('Xb')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
34 call mkdir('Xc')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
35 try
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
36 args Xa/aaa.txt Xb/bbb.txt
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
37 set acd
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
38 let winid = win_getid()
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
39 snext
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
40 call assert_equal('Xb', substitute(getcwd(), '.*/\([^/]*\)$', '\1', ''))
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
41 call win_execute(winid, 'file ' .. cwd .. '/Xc/ccc.txt')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
42 call assert_equal('Xb', substitute(getcwd(), '.*/\([^/]*\)$', '\1', ''))
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
43 finally
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
44 set noacd
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
45 call chdir(cwd)
26422
4397cc04f2b1 patch 8.2.3742: dec mouse test fails without gnome terminfo entry
Bram Moolenaar <Bram@vim.org>
parents: 26416
diff changeset
46 bwipe! aaa.txt
4397cc04f2b1 patch 8.2.3742: dec mouse test fails without gnome terminfo entry
Bram Moolenaar <Bram@vim.org>
parents: 26416
diff changeset
47 bwipe! bbb.txt
4397cc04f2b1 patch 8.2.3742: dec mouse test fails without gnome terminfo entry
Bram Moolenaar <Bram@vim.org>
parents: 26416
diff changeset
48 bwipe! ccc.txt
26416
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
49 call delete('Xa', 'rf')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
50 call delete('Xb', 'rf')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
51 call delete('Xc', 'rf')
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
52 endtry
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
53 endfunc
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
54
26171
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
55 func Test_verbose_pwd()
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
56 let cwd = getcwd()
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
57 call test_autochdir()
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
58
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
59 edit global.txt
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
60 call assert_match('\[global\].*testdir$', execute('verbose pwd'))
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
61
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
62 call mkdir('Xautodir')
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
63 split Xautodir/local.txt
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
64 lcd Xautodir
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
65 call assert_match('\[window\].*testdir[/\\]Xautodir', execute('verbose pwd'))
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
66
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
67 set acd
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
68 wincmd w
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
69 call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
26181
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
70 execute 'lcd' cwd
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
71 call assert_match('\[window\].*testdir$', execute('verbose pwd'))
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
72 execute 'tcd' cwd
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
73 call assert_match('\[tabpage\].*testdir$', execute('verbose pwd'))
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
74 execute 'cd' cwd
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
75 call assert_match('\[global\].*testdir$', execute('verbose pwd'))
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
76 edit
027c5b4b6f07 patch 8.2.3622: "verbose pwd" shows confusing info
Bram Moolenaar <Bram@vim.org>
parents: 26171
diff changeset
77 call assert_match('\[autochdir\].*testdir$', execute('verbose pwd'))
26171
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
78 wincmd w
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
79 call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
80 set noacd
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
81 call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
82 wincmd w
26416
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
83 call assert_match('\[autochdir\].*testdir[/\\]Xautodir', execute('verbose pwd'))
7606d9b13068 patch 8.2.3739: in wrong directory when using win_execute() with 'acd' set
Bram Moolenaar <Bram@vim.org>
parents: 26181
diff changeset
84 execute 'cd' cwd
26171
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
85 call assert_match('\[global\].*testdir', execute('verbose pwd'))
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
86 wincmd w
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
87 call assert_match('\[window\].*testdir[/\\]Xautodir', execute('verbose pwd'))
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
88
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
89 bwipe!
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
90 call chdir(cwd)
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
91 call delete('Xautodir', 'rf')
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
92 endfunc
fa8161b003f6 patch 8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
93
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 18568
diff changeset
94 " vim: shiftwidth=2 sts=2 expandtab