Mercurial > vim
annotate src/testdir/test_windows_home.vim @ 16772:18093a6accb5 v8.1.1388
patch 8.1.1388: errors when calling prop_remove() for an unloaded buffer
commit https://github.com/vim/vim/commit/f0884c5f3f5a25481d1e16f0979aa978a6690bb1
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 24 21:22:29 2019 +0200
patch 8.1.1388: errors when calling prop_remove() for an unloaded buffer
Problem: Errors when calling prop_remove() for an unloaded buffer.
Solution: Bail out when the buffer is not loaded. Add a few more tests for
failing when the buffer number is invalid.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 May 2019 21:30:05 +0200 |
parents | 67bc88591ede |
children | f38fcbf343ce |
rev | line source |
---|---|
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for $HOME on Windows. |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 if !has('win32') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 finish |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 endif |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 let s:env = {} |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 func s:restore_env() |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 for i in keys(s:env) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 exe 'let ' . i . '=s:env["' . i . '"]' |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 endfor |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 endfunc |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 func s:save_env(...) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 for i in a:000 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 exe 'let s:env["' . i . '"]=' . i |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 endfor |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 endfunc |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 func s:unlet_env(...) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 for i in a:000 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 exe 'let ' . i . '=""' |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 endfor |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 endfunc |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 func CheckHomeIsMissingFromSubprocessEnvironment() |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 silent! let out = system('set') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 let env = filter(split(out, "\n"), 'v:val=~"^HOME="') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call assert_equal(0, len(env)) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 endfunc |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 func CheckHomeIsInSubprocessEnvironment(exp) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 silent! let out = system('set') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 let env = filter(split(out, "\n"), 'v:val=~"^HOME="') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 let home = len(env) == 0 ? "" : substitute(env[0], '[^=]\+=', '', '') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 call assert_equal(a:exp, home) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 endfunc |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 func CheckHome(exp, ...) |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
41 call assert_equal(a:exp, $HOME) |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
42 call assert_equal(a:exp, expand('~', ':p')) |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 if !a:0 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 call CheckHomeIsMissingFromSubprocessEnvironment() |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 else |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
46 call CheckHomeIsInSubprocessEnvironment(a:1) |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 endif |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 endfunc |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
50 func Test_WindowsHome() |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 command! -nargs=* SaveEnv call <SID>save_env(<f-args>) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 command! -nargs=* RestoreEnv call <SID>restore_env() |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 command! -nargs=* UnletEnv call <SID>unlet_env(<f-args>) |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
54 set noshellslash |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
56 let save_home = $HOME |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
57 SaveEnv $USERPROFILE $HOMEDRIVE $HOMEPATH |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 try |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
59 " Normal behavior: use $HOMEDRIVE and $HOMEPATH, ignore $USERPROFILE |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
60 let $USERPROFILE = 'unused' |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 let $HOMEDRIVE = 'C:' |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 let $HOMEPATH = '\foobar' |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
63 let $HOME = '' " Force recomputing "homedir" |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 call CheckHome('C:\foobar') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
66 " Same, but with $HOMEPATH not set |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
67 UnletEnv $HOMEPATH |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
68 let $HOME = '' " Force recomputing "homedir" |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
69 call CheckHome('C:\') |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
71 " Use $USERPROFILE if $HOMEPATH and $HOMEDRIVE are empty |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
72 UnletEnv $HOMEDRIVE $HOMEPATH |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 let $USERPROFILE = 'C:\foo' |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
74 let $HOME = '' " Force recomputing "homedir" |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 call CheckHome('C:\foo') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
77 " If $HOME is set the others don't matter |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 let $HOME = 'C:\bar' |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
79 let $USERPROFILE = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
80 let $HOMEDRIVE = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
81 let $HOMEPATH = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
82 call CheckHome('C:\bar', 'C:\bar') |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
84 " If $HOME contains %USERPROFILE% it is expanded |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 let $USERPROFILE = 'C:\foo' |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
86 let $HOME = '%USERPROFILE%\bar' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
87 let $HOMEDRIVE = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
88 let $HOMEPATH = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
89 call CheckHome('C:\foo\bar', '%USERPROFILE%\bar') |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
91 " Invalid $HOME is kept |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 let $USERPROFILE = 'C:\foo' |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
93 let $HOME = '%USERPROFILE' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
94 let $HOMEDRIVE = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
95 let $HOMEPATH = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
96 call CheckHome('%USERPROFILE', '%USERPROFILE') |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
98 " %USERPROFILE% not at start of $HOME is not expanded |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
99 let $USERPROFILE = 'unused' |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 let $HOME = 'C:\%USERPROFILE%' |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
101 let $HOMEDRIVE = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
102 let $HOMEPATH = 'unused' |
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
103 call CheckHome('C:\%USERPROFILE%', 'C:\%USERPROFILE%') |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 if has('channel') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 RestoreEnv |
12275
67bc88591ede
patch 8.0.1017: test for MS-Windows $HOME always passes
Christian Brabandt <cb@256bit.org>
parents:
12265
diff
changeset
|
107 let $HOME = save_home |
12265
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 let env = '' |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 let job = job_start('cmd /c set', {'out_cb': {ch,x->[env,execute('let env=x')]}}) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 sleep 1 |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 let env = filter(split(env, "\n"), 'v:val=="HOME"') |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 let home = len(env) == 0 ? "" : env[0] |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 call assert_equal('', home) |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 endif |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 finally |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 RestoreEnv |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 delcommand SaveEnv |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 delcommand RestoreEnv |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 delcommand UnletEnv |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 endtry |
03e4be2e3d53
patch 8.0.1012: MS-Windows: problem with $HOME when is was set internally
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 endfunc |