annotate src/testdir/test60.in @ 5086:6ddc1785c4ff v7.3.1286

updated for version 7.3.1286 Problem: Check for screen size missing for Athena and Motif. Solution: Add call to limit_screen_size().
author Bram Moolenaar <bram@vim.org>
date Mon, 01 Jul 2013 21:43:08 +0200
parents b63792dadc23
children b43363a7b4c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
1 Tests for the exists() function. vim: set ft=vim :
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
2
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
3 STARTTEST
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
4 :so small.vim
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
5 :function! RunTest(str, result)
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
6 if exists(a:str) == a:result
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
7 echo "OK"
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
8 else
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
9 echo "FAILED: Checking for " . a:str
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
10 endif
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
11 endfunction
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
12 :function! TestExists()
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
13 augroup myagroup
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
14 autocmd! BufEnter *.my echo 'myfile edited'
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
15 augroup END
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
16
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
17 let test_cases = []
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
18
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
19 " valid autocmd group
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
20 let test_cases += [['#myagroup', 1]]
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
21 " valid autocmd group with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
22 let test_cases += [['#myagroup+b', 0]]
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
23 " Valid autocmd group and event
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
24 let test_cases += [['#myagroup#BufEnter', 1]]
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
25 " Valid autocmd group, event and pattern
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
26 let test_cases += [['#myagroup#BufEnter#*.my', 1]]
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
27 " Valid autocmd event
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
28 let test_cases += [['#BufEnter', 1]]
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
29 " Valid autocmd event and pattern
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
30 let test_cases += [['#BufEnter#*.my', 1]]
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
31 " Non-existing autocmd group or event
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
32 let test_cases += [['#xyzagroup', 0]]
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
33 " Non-existing autocmd group and valid autocmd event
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
34 let test_cases += [['#xyzagroup#BufEnter', 0]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
35 " Valid autocmd group and event with no matching pattern
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
36 let test_cases += [['#myagroup#CmdwinEnter', 0]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
37 " Valid autocmd group and non-existing autocmd event
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
38 let test_cases += [['#myagroup#xyzacmd', 0]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
39 " Valid autocmd group and event and non-matching pattern
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
40 let test_cases += [['#myagroup#BufEnter#xyzpat', 0]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
41 " Valid autocmd event and non-matching pattern
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
42 let test_cases += [['#BufEnter#xyzpat', 0]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
43 " Empty autocmd group, event and pattern
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
44 let test_cases += [['###', 0]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
45 " Empty autocmd group and event or empty event and pattern
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
46 let test_cases += [['##', 0]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
47 " Valid autocmd event
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
48 let test_cases += [['##FileReadCmd', 1]]
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
49 " Non-existing autocmd event
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
50 let test_cases += [['##MySpecialCmd', 0]]
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
51
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
52 " Existing and working option (long form)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
53 let test_cases += [['&textwidth', 1]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
54 " Existing and working option (short form)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
55 let test_cases += [['&tw', 1]]
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
56 " Existing and working option with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
57 let test_cases += [['&tw-', 0]]
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
58 " Global option
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
59 let test_cases += [['&g:errorformat', 1]]
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
60 " Local option
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
61 let test_cases += [['&l:errorformat', 1]]
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
62 " Negative form of existing and working option (long form)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
63 let test_cases += [['&nojoinspaces', 0]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
64 " Negative form of existing and working option (short form)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
65 let test_cases += [['&nojs', 0]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
66 " Non-existing option
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
67 let test_cases += [['&myxyzoption', 0]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
68
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
69 " Existing and working option (long form)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
70 let test_cases += [['+incsearch', 1]]
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
71 " Existing and working option with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
72 let test_cases += [['+incsearch!1', 0]]
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
73 " Existing and working option (short form)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
74 let test_cases += [['+is', 1]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
75 " Existing option that is hidden.
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
76 let test_cases += [['+autoprint', 0]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
77
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
78 " Existing environment variable
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
79 let $EDITOR_NAME = 'Vim Editor'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
80 let test_cases += [['$EDITOR_NAME', 1]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
81 " Non-existing environment variable
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
82 let test_cases += [['$NON_ENV_VAR', 0]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
83
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
84 " Valid internal function
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
85 let test_cases += [['*bufnr', 1]]
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
86 " Valid internal function with ()
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
87 let test_cases += [['*bufnr()', 1]]
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
88 " Non-existing internal function
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
89 let test_cases += [['*myxyzfunc', 0]]
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
90 " Valid internal function with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
91 let test_cases += [['*bufnr&6', 0]]
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
92
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
93 " Valid user defined function
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
94 let test_cases += [['*TestExists', 1]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
95 " Non-existing user defined function
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
96 let test_cases += [['*MyxyzFunc', 0]]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
97
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
98 redir! > test.out
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
99
617
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
100 for [test_case, result] in test_cases
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
101 echo test_case . ": " . result
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
102 call RunTest(test_case, result)
1797ca316f1c updated for version 7.0176
vimboss
parents: 615
diff changeset
103 endfor
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
104
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
105 " Valid internal command (full match)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
106 echo ':edit: 2'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
107 if exists(':edit') == 2
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
108 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
109 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
110 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
111 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
112
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
113 " Valid internal command (full match) with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
114 echo ':edit/a: 0'
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
115 if exists(':edit/a') == 0
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
116 echo "OK"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
117 else
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
118 echo "FAILED"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
119 endif
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
120
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
121 " Valid internal command (partial match)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
122 echo ':q: 1'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
123 if exists(':q') == 1
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
124 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
125 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
126 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
127 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
128
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
129 " Non-existing internal command
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
130 echo ':invalidcmd: 0'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
131 if !exists(':invalidcmd')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
132 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
133 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
134 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
135 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
136
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
137 " User defined command (full match)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
138 command! MyCmd :echo 'My command'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
139 echo ':MyCmd: 2'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
140 if exists(':MyCmd') == 2
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
141 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
142 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
143 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
144 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
145
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
146 " User defined command (partial match)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
147 command! MyOtherCmd :echo 'Another command'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
148 echo ':My: 3'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
149 if exists(':My') == 3
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
150 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
151 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
152 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
153 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
154
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
155 " Command modifier
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
156 echo ':rightbelow: 2'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
157 if exists(':rightbelow') == 2
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
158 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
159 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
160 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
161 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
162
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
163 " Non-existing user defined command (full match)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
164 delcommand MyCmd
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
165
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
166 echo ':MyCmd: 0'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
167 if !exists(':MyCmd')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
168 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
169 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
170 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
171 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
172
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
173 " Non-existing user defined command (partial match)
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
174 delcommand MyOtherCmd
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
175
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
176 echo ':My: 0'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
177 if !exists(':My')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
178 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
179 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
180 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
181 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
182
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
183 " Valid local variable
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
184 let local_var = 1
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
185 echo 'local_var: 1'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
186 if exists('local_var')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
187 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
188 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
189 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
190 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
191
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
192 " Valid local variable with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
193 let local_var = 1
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
194 echo 'local_var%n: 0'
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
195 if !exists('local_var%n')
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
196 echo "OK"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
197 else
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
198 echo "FAILED"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
199 endif
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
200
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
201 " Non-existing local variable
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
202 unlet local_var
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
203 echo 'local_var: 0'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
204 if !exists('local_var')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
205 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
206 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
207 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
208 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
209
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
210 " Valid local list
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
211 let local_list = ["blue", "orange"]
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
212 echo 'local_list: 1'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
213 if exists('local_list')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
214 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
215 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
216 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
217 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
218
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
219 " Valid local list item
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
220 echo 'local_list[1]: 1'
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
221 if exists('local_list[1]')
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
222 echo "OK"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
223 else
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
224 echo "FAILED"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
225 endif
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
226
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
227 " Valid local list item with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
228 echo 'local_list[1]+5: 0'
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
229 if !exists('local_list[1]+5')
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
230 echo "OK"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
231 else
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
232 echo "FAILED"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
233 endif
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
234
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
235 " Invalid local list item
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
236 echo 'local_list[2]: 0'
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
237 if !exists('local_list[2]')
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
238 echo "OK"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
239 else
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
240 echo "FAILED"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
241 endif
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
242
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
243 " Non-existing local list
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
244 unlet local_list
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
245 echo 'local_list: 0'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
246 if !exists('local_list')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
247 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
248 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
249 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
250 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
251
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
252 " Valid local dictionary
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
253 let local_dict = {"xcord":100, "ycord":2}
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
254 echo 'local_dict: 1'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
255 if exists('local_dict')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
256 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
257 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
258 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
259 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
260
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
261 " Non-existing local dictionary
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
262 unlet local_dict
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
263 echo 'local_dict: 0'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
264 if !exists('local_dict')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
265 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
266 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
267 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
268 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
269
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
270 " Existing local curly-brace variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
271 let str = "local"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
272 let curly_{str}_var = 1
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
273 echo 'curly_' . str . '_var: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
274 if exists('curly_{str}_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
275 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
276 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
277 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
278 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
279
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
280 " Non-existing local curly-brace variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
281 unlet curly_{str}_var
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
282 echo 'curly_' . str . '_var: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
283 if !exists('curly_{str}_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
284 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
285 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
286 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
287 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
288
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
289
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
290 " Existing global variable
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
291 let g:global_var = 1
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
292 echo 'g:global_var: 1'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
293 if exists('g:global_var')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
294 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
295 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
296 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
297 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
298
867
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
299 " Existing global variable with garbage
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
300 echo 'g:global_var-n: 1'
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
301 if !exists('g:global_var-n')
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
302 echo "OK"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
303 else
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
304 echo "FAILED"
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
305 endif
a5677b7ce858 updated for version 7.0g04
vimboss
parents: 625
diff changeset
306
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
307 " Non-existing global variable
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
308 unlet g:global_var
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
309 echo 'g:global_var: 0'
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
310 if !exists('g:global_var')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
311 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
312 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
313 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
314 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
315
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
316 " Existing global list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
317 let g:global_list = ["blue", "orange"]
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
318 echo 'g:global_list: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
319 if exists('g:global_list')
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
320 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
321 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
322 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
323 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
324
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
325 " Non-existing global list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
326 unlet g:global_list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
327 echo 'g:global_list: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
328 if !exists('g:global_list')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
329 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
330 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
331 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
332 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
333
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
334 " Existing global dictionary
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
335 let g:global_dict = {"xcord":100, "ycord":2}
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
336 echo 'g:global_dict: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
337 if exists('g:global_dict')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
338 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
339 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
340 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
341 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
342
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
343 " Non-existing global dictionary
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
344 unlet g:global_dict
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
345 echo 'g:global_dict: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
346 if !exists('g:global_dict')
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
347 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
348 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
349 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
350 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
351
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
352 " Existing global curly-brace variable
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
353 let str = "global"
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
354 let g:curly_{str}_var = 1
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
355 echo 'g:curly_' . str . '_var: 1'
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
356 if exists('g:curly_{str}_var')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
357 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
358 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
359 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
360 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
361
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
362 " Non-existing global curly-brace variable
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
363 unlet g:curly_{str}_var
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
364 echo 'g:curly_' . str . '_var: 0'
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
365 if !exists('g:curly_{str}_var')
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
366 echo "OK"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
367 else
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
368 echo "FAILED"
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
369 endif
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
370
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
371 " Existing window variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
372 echo 'w:window_var: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
373 let w:window_var = 1
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
374 if exists('w:window_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
375 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
376 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
377 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
378 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
379
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
380 " Non-existing window variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
381 unlet w:window_var
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
382 echo 'w:window_var: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
383 if !exists('w:window_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
384 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
385 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
386 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
387 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
388
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
389 " Existing window list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
390 let w:window_list = ["blue", "orange"]
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
391 echo 'w:window_list: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
392 if exists('w:window_list')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
393 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
394 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
395 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
396 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
397
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
398 " Non-existing window list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
399 unlet w:window_list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
400 echo 'w:window_list: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
401 if !exists('w:window_list')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
402 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
403 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
404 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
405 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
406
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
407 " Existing window dictionary
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
408 let w:window_dict = {"xcord":100, "ycord":2}
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
409 echo 'w:window_dict: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
410 if exists('w:window_dict')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
411 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
412 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
413 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
414 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
415
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
416 " Non-existing window dictionary
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
417 unlet w:window_dict
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
418 echo 'w:window_dict: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
419 if !exists('w:window_dict')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
420 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
421 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
422 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
423 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
424
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
425 " Existing window curly-brace variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
426 let str = "window"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
427 let w:curly_{str}_var = 1
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
428 echo 'w:curly_' . str . '_var: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
429 if exists('w:curly_{str}_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
430 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
431 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
432 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
433 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
434
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
435 " Non-existing window curly-brace variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
436 unlet w:curly_{str}_var
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
437 echo 'w:curly_' . str . '_var: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
438 if !exists('w:curly_{str}_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
439 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
440 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
441 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
442 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
443
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
444 " Existing buffer variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
445 echo 'b:buffer_var: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
446 let b:buffer_var = 1
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
447 if exists('b:buffer_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
448 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
449 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
450 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
451 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
452
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
453 " Non-existing buffer variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
454 unlet b:buffer_var
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
455 echo 'b:buffer_var: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
456 if !exists('b:buffer_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
457 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
458 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
459 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
460 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
461
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
462 " Existing buffer list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
463 let b:buffer_list = ["blue", "orange"]
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
464 echo 'b:buffer_list: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
465 if exists('b:buffer_list')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
466 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
467 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
468 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
469 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
470
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
471 " Non-existing buffer list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
472 unlet b:buffer_list
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
473 echo 'b:buffer_list: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
474 if !exists('b:buffer_list')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
475 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
476 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
477 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
478 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
479
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
480 " Existing buffer dictionary
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
481 let b:buffer_dict = {"xcord":100, "ycord":2}
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
482 echo 'b:buffer_dict: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
483 if exists('b:buffer_dict')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
484 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
485 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
486 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
487 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
488
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
489 " Non-existing buffer dictionary
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
490 unlet b:buffer_dict
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
491 echo 'b:buffer_dict: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
492 if !exists('b:buffer_dict')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
493 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
494 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
495 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
496 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
497
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
498 " Existing buffer curly-brace variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
499 let str = "buffer"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
500 let b:curly_{str}_var = 1
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
501 echo 'b:curly_' . str . '_var: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
502 if exists('b:curly_{str}_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
503 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
504 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
505 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
506 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
507
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
508 " Non-existing buffer curly-brace variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
509 unlet b:curly_{str}_var
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
510 echo 'b:curly_' . str . '_var: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
511 if !exists('b:curly_{str}_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
512 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
513 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
514 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
515 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
516
620
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
517 " Script-local tests
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
518 source test60.vim
9e359e5759f6 updated for version 7.0177
vimboss
parents: 617
diff changeset
519
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
520 " Existing Vim internal variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
521 echo 'v:version: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
522 if exists('v:version')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
523 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
524 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
525 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
526 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
527
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
528 " Non-existing Vim internal variable
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
529 echo 'v:non_exists_var: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
530 if !exists('v:non_exists_var')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
531 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
532 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
533 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
534 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
535
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
536 " Function arguments
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
537 function TestFuncArg(func_arg, ...)
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
538 echo 'a:func_arg: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
539 if exists('a:func_arg')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
540 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
541 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
542 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
543 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
544
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
545 echo 'a:non_exists_arg: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
546 if !exists('a:non_exists_arg')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
547 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
548 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
549 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
550 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
551
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
552 echo 'a:1: 1'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
553 if exists('a:1')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
554 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
555 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
556 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
557 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
558
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
559 echo 'a:2: 0'
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
560 if !exists('a:2')
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
561 echo "OK"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
562 else
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
563 echo "FAILED"
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
564 endif
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
565 endfunction
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
566
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
567 call TestFuncArg("arg1", "arg2")
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 620
diff changeset
568
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
569 redir END
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
570 endfunction
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
571 :call TestExists()
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 867
diff changeset
572 :delfunc TestExists
b63792dadc23 updated for version 7.1-120
vimboss
parents: 867
diff changeset
573 :delfunc RunTest
b63792dadc23 updated for version 7.1-120
vimboss
parents: 867
diff changeset
574 :delfunc TestFuncArg
615
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
575 :edit! test.out
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
576 :set ff=unix
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
577 :w
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
578 :qa!
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
579 ENDTEST
7fe13e0f5dce updated for version 7.0175
vimboss
parents:
diff changeset
580