Mercurial > vim
annotate src/testdir/test86.in @ 17565:0026ea34a8d5 v8.1.1780
patch 8.1.1780: warning for file no longer available is repeated
commit https://github.com/vim/vim/commit/674e2bde6e7b0c468f304713aa8f97a45e1fcc89
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 31 20:21:01 2019 +0200
patch 8.1.1780: warning for file no longer available is repeated
Problem: Warning for file no longer available is repeated every time Vim is
focused. (Brian Armstrong)
Solution: Only give the message once. (closes #4748)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 31 Jul 2019 20:30:07 +0200 |
parents | 32dd27cceadd |
children | 068337e86133 |
rev | line source |
---|---|
3618 | 1 Tests for various python features. vim: set ft=vim : |
2 | |
4149 | 3 NOTE: This will cause errors when run under valgrind. |
4 This would require recompiling Python with: | |
5 ./configure --without-pymalloc | |
6 See http://svn.python.org/view/python/trunk/Misc/README.valgrind?view=markup | |
7 | |
3618 | 8 STARTTEST |
9 :so small.vim | |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
10 :set encoding=latin1 |
4851
96e154e825a7
updated for version 7.3.1172
Bram Moolenaar <bram@vim.org>
parents:
4839
diff
changeset
|
11 :set noswapfile |
3618 | 12 :if !has('python') | e! test.ok | wq! test.out | endif |
4425 | 13 :lang C |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
14 :fun Test() |
3618 | 15 :py import vim |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
16 :py cb = vim.current.buffer |
3618 | 17 :let l = [] |
18 :py l=vim.bindeval('l') | |
19 :py f=vim.bindeval('function("strlen")') | |
20 :" Extending List directly with different types | |
21 :py l.extend([1, "as'd", [1, 2, f, {'a': 1}]]) | |
22 :$put =string(l) | |
23 :$put =string(l[-1]) | |
24 :try | |
25 : $put =string(l[-4]) | |
26 :catch | |
27 : $put =v:exception[:13] | |
28 :endtry | |
29 :" List assignment | |
30 :py l[0]=0 | |
31 :$put =string(l) | |
32 :py l[-2]=f | |
33 :$put =string(l) | |
34 :" | |
35 :" Extending Dictionary directly with different types | |
36 :let d = {} | |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
37 :fun d.f() |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
38 : return 1 |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
39 :endfun |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
40 py << EOF |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
41 d=vim.bindeval('d') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
42 d['1']='asd' |
5659 | 43 d.update() # Must not do anything, including throwing errors |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
44 d.update(b=[1, 2, f]) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
45 d.update((('-1', {'a': 1}),)) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
46 d.update({'0': -1}) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
47 dk = d.keys() |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
48 dv = d.values() |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
49 di = d.items() |
4853
b584d361e746
updated for version 7.3.1173
Bram Moolenaar <bram@vim.org>
parents:
4851
diff
changeset
|
50 cmpfun = lambda a, b: cmp(repr(a), repr(b)) |
b584d361e746
updated for version 7.3.1173
Bram Moolenaar <bram@vim.org>
parents:
4851
diff
changeset
|
51 dk.sort(cmpfun) |
b584d361e746
updated for version 7.3.1173
Bram Moolenaar <bram@vim.org>
parents:
4851
diff
changeset
|
52 dv.sort(cmpfun) |
b584d361e746
updated for version 7.3.1173
Bram Moolenaar <bram@vim.org>
parents:
4851
diff
changeset
|
53 di.sort(cmpfun) |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
54 EOF |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
55 :$put =pyeval('d[''f''](self={})') |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
56 :$put =pyeval('repr(dk)') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
57 :$put =substitute(pyeval('repr(dv)'),'0x\x\+','','g') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
58 :$put =substitute(pyeval('repr(di)'),'0x\x\+','','g') |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
59 :for [key, Val] in sort(items(d)) |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
60 : $put =string(key) . ' : ' . string(Val) |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
61 : unlet key Val |
3618 | 62 :endfor |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
63 :py del dk |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
64 :py del di |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
65 :py del dv |
3618 | 66 :" |
67 :" removing items with del | |
68 :py del l[2] | |
69 :$put =string(l) | |
70 :let l = range(8) | |
71 :py l=vim.bindeval('l') | |
72 :try | |
73 : py del l[:3] | |
74 : py del l[1:] | |
75 :catch | |
76 : $put =v:exception | |
77 :endtry | |
78 :$put =string(l) | |
79 :" | |
80 :py del d['-1'] | |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
81 :py del d['f'] |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
82 :$put =string(pyeval('d.get(''b'', 1)')) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
83 :$put =string(pyeval('d.pop(''b'')')) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
84 :$put =string(pyeval('d.get(''b'', 1)')) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
85 :$put =string(pyeval('d.pop(''1'', 2)')) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
86 :$put =string(pyeval('d.pop(''1'', 2)')) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
87 :$put =pyeval('repr(d.has_key(''0''))') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
88 :$put =pyeval('repr(d.has_key(''1''))') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
89 :$put =pyeval('repr(''0'' in d)') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
90 :$put =pyeval('repr(''1'' in d)') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
91 :$put =pyeval('repr(list(iter(d)))') |
3618 | 92 :$put =string(d) |
4698
2db005052371
updated for version 7.3.1096
Bram Moolenaar <bram@vim.org>
parents:
4684
diff
changeset
|
93 :$put =pyeval('repr(d.popitem())') |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
94 :$put =pyeval('repr(d.get(''0''))') |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
95 :$put =pyeval('repr(list(iter(d)))') |
3618 | 96 :" |
97 :" removing items out of range: silently skip items that don't exist | |
98 :let l = [0, 1, 2, 3] | |
99 :py l=vim.bindeval('l') | |
100 :" The following two ranges delete nothing as they match empty list: | |
101 :py del l[2:1] | |
102 :$put =string(l) | |
103 :py del l[2:2] | |
104 :$put =string(l) | |
105 :py del l[2:3] | |
106 :$put =string(l) | |
107 :let l = [0, 1, 2, 3] | |
108 :py l=vim.bindeval('l') | |
109 :py del l[2:4] | |
110 :$put =string(l) | |
111 :let l = [0, 1, 2, 3] | |
112 :py l=vim.bindeval('l') | |
113 :py del l[2:5] | |
114 :$put =string(l) | |
115 :let l = [0, 1, 2, 3] | |
116 :py l=vim.bindeval('l') | |
117 :py del l[2:6] | |
118 :$put =string(l) | |
119 :let l = [0, 1, 2, 3] | |
120 :py l=vim.bindeval('l') | |
121 :" The following two ranges delete nothing as they match empty list: | |
122 :py del l[-1:2] | |
123 :$put =string(l) | |
124 :py del l[-2:2] | |
125 :$put =string(l) | |
126 :py del l[-3:2] | |
127 :$put =string(l) | |
128 :let l = [0, 1, 2, 3] | |
129 :py l=vim.bindeval('l') | |
130 :py del l[-4:2] | |
131 :$put =string(l) | |
132 :let l = [0, 1, 2, 3] | |
133 :py l=vim.bindeval('l') | |
134 :py del l[-5:2] | |
135 :$put =string(l) | |
136 :let l = [0, 1, 2, 3] | |
137 :py l=vim.bindeval('l') | |
138 :py del l[-6:2] | |
139 :$put =string(l) | |
5608 | 140 :let l = [0, 1, 2, 3] |
141 :py l=vim.bindeval('l') | |
142 :py del l[::2] | |
143 :$put =string(l) | |
144 :let l = [0, 1, 2, 3] | |
145 :py l=vim.bindeval('l') | |
146 :py del l[3:0:-2] | |
147 :$put =string(l) | |
148 :let l = [0, 1, 2, 3] | |
149 :py l=vim.bindeval('l') | |
150 :py del l[2:4:-2] | |
151 :$put =string(l) | |
3618 | 152 :" |
153 :" Slice assignment to a list | |
154 :let l = [0, 1, 2, 3] | |
155 :py l=vim.bindeval('l') | |
156 :py l[0:0]=['a'] | |
157 :$put =string(l) | |
158 :let l = [0, 1, 2, 3] | |
159 :py l=vim.bindeval('l') | |
160 :py l[1:2]=['b'] | |
161 :$put =string(l) | |
162 :let l = [0, 1, 2, 3] | |
163 :py l=vim.bindeval('l') | |
164 :py l[2:4]=['c'] | |
165 :$put =string(l) | |
166 :let l = [0, 1, 2, 3] | |
167 :py l=vim.bindeval('l') | |
168 :py l[4:4]=['d'] | |
169 :$put =string(l) | |
170 :let l = [0, 1, 2, 3] | |
171 :py l=vim.bindeval('l') | |
172 :py l[-1:2]=['e'] | |
173 :$put =string(l) | |
174 :let l = [0, 1, 2, 3] | |
175 :py l=vim.bindeval('l') | |
176 :py l[-10:2]=['f'] | |
177 :$put =string(l) | |
178 :let l = [0, 1, 2, 3] | |
179 :py l=vim.bindeval('l') | |
180 :py l[2:-10]=['g'] | |
181 :$put =string(l) | |
182 :let l = [] | |
183 :py l=vim.bindeval('l') | |
184 :py l[0:0]=['h'] | |
185 :$put =string(l) | |
5608 | 186 :let l = range(8) |
187 :py l=vim.bindeval('l') | |
188 :py l[2:6:2] = [10, 20] | |
189 :$put =string(l) | |
190 :let l = range(8) | |
191 :py l=vim.bindeval('l') | |
192 :py l[6:2:-2] = [10, 20] | |
193 :$put =string(l) | |
194 :let l = range(8) | |
195 :py l=vim.bindeval('l') | |
196 :py l[6:2] = () | |
197 :$put =string(l) | |
198 :let l = range(8) | |
199 :py l=vim.bindeval('l') | |
200 :py l[6:2:1] = () | |
201 :$put =string(l) | |
202 :let l = range(8) | |
203 :py l=vim.bindeval('l') | |
204 :py l[2:2:1] = () | |
205 :$put =string(l) | |
3618 | 206 :" |
207 :" Locked variables | |
208 :let l = [0, 1, 2, 3] | |
209 :py l=vim.bindeval('l') | |
210 :lockvar! l | |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
211 py << EOF |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
212 def emsg(ei): |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
213 return ei[0].__name__ + ':' + repr(ei[1].args) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
214 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
215 try: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
216 l[2]='i' |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
217 except vim.error: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
218 cb.append('l[2] threw vim.error: ' + emsg(sys.exc_info())) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
219 EOF |
3618 | 220 :$put =string(l) |
221 :unlockvar! l | |
222 :" | |
223 :" Function calls | |
5517 | 224 py << EOF |
225 import sys | |
226 def ee(expr, g=globals(), l=locals()): | |
227 try: | |
228 exec(expr, g, l) | |
229 except: | |
230 ei = sys.exc_info() | |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
231 msg = emsg(ei) |
5517 | 232 msg = msg.replace('TypeError:(\'argument 1 ', 'TypeError:(\'') |
233 if expr.find('None') > -1: | |
234 msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', | |
235 'TypeError:("\'NoneType\' object is not iterable",)') | |
236 if expr.find('FailingNumber') > -1: | |
237 msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'') | |
238 msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', | |
239 'TypeError:("\'FailingNumber\' object is not iterable",)') | |
240 if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1: | |
241 msg = msg.replace('(\'', '("').replace('\',)', '",)') | |
10160
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
242 # Some Python versions say can't, others cannot. |
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
243 if msg.find('can\'t') > -1: |
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
244 msg = msg.replace('can\'t', 'cannot') |
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
245 # Some Python versions use single quote, some double quote |
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
246 if msg.find('"cannot ') > -1: |
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
247 msg = msg.replace('"cannot ', '\'cannot ') |
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
248 if msg.find(' attributes"') > -1: |
32dd27cceadd
commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740
Christian Brabandt <cb@256bit.org>
parents:
9119
diff
changeset
|
249 msg = msg.replace(' attributes"', ' attributes\'') |
5517 | 250 if expr == 'fd(self=[])': |
251 # HACK: PyMapping_Check changed meaning | |
252 msg = msg.replace('AttributeError:(\'keys\',)', | |
253 'TypeError:(\'unable to convert list to vim dictionary\',)') | |
254 vim.current.buffer.append(expr + ':' + msg) | |
255 else: | |
256 vim.current.buffer.append(expr + ':NOT FAILED') | |
257 EOF | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
258 :fun New(...) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
259 : return ['NewStart']+a:000+['NewEnd'] |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
260 :endfun |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
261 :fun DictNew(...) dict |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
262 : return ['DictNewStart']+a:000+['DictNewEnd', self] |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
263 :endfun |
3618 | 264 :let l=[function('New'), function('DictNew')] |
265 :py l=vim.bindeval('l') | |
266 :py l.extend(list(l[0](1, 2, 3))) | |
267 :$put =string(l) | |
268 :py l.extend(list(l[1](1, 2, 3, self={'a': 'b'}))) | |
269 :$put =string(l) | |
270 :py l.extend([l[0].name]) | |
271 :$put =string(l) | |
5517 | 272 :py ee('l[1](1, 2, 3)') |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
273 :py f=l[0] |
3618 | 274 :delfunction New |
5517 | 275 :py ee('f(1, 2, 3)') |
3618 | 276 :if has('float') |
277 : let l=[0.0] | |
278 : py l=vim.bindeval('l') | |
279 : py l.extend([0.0]) | |
280 : $put =string(l) | |
281 :else | |
282 : $put ='[0.0, 0.0]' | |
283 :endif | |
3802 | 284 :let messages=[] |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
285 :delfunction DictNew |
4399 | 286 py <<EOF |
3802 | 287 d=vim.bindeval('{}') |
288 m=vim.bindeval('messages') | |
4399 | 289 def em(expr, g=globals(), l=locals()): |
290 try: | |
291 exec(expr, g, l) | |
292 except: | |
293 m.extend([sys.exc_type.__name__]) | |
3802 | 294 |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
295 em('d["abc1"]') |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
296 em('d["abc1"]="\\0"') |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
297 em('d["abc1"]=vim') |
4399 | 298 em('d[""]=1') |
299 em('d["a\\0b"]=1') | |
300 em('d[u"a\\0b"]=1') | |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
301 |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
302 em('d.pop("abc1")') |
4698
2db005052371
updated for version 7.3.1096
Bram Moolenaar <bram@vim.org>
parents:
4684
diff
changeset
|
303 em('d.popitem()') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
304 del em |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
305 del m |
3802 | 306 EOF |
307 :$put =messages | |
3828 | 308 :unlet messages |
309 :" locked and scope attributes | |
310 :let d={} | let dl={} | lockvar dl | |
311 :for s in split("d dl v: g:") | |
312 : let name=tr(s, ':', 's') | |
313 : execute 'py '.name.'=vim.bindeval("'.s.'")' | |
314 : let toput=s.' : '.join(map(['locked', 'scope'], 'v:val.":".pyeval(name.".".v:val)'), ';') | |
315 : $put =toput | |
316 :endfor | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
317 :silent! let d.abc2=1 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
318 :silent! let dl.abc3=1 |
3828 | 319 :py d.locked=True |
320 :py dl.locked=False | |
321 :silent! let d.def=1 | |
322 :silent! let dl.def=1 | |
323 :put ='d:'.string(d) | |
324 :put ='dl:'.string(dl) | |
325 :unlet d dl | |
326 : | |
327 :let l=[] | let ll=[] | lockvar ll | |
328 :for s in split("l ll") | |
329 : let name=tr(s, ':', 's') | |
330 : execute 'py '.name.'=vim.bindeval("'.s.'")' | |
331 : let toput=s.' : locked:'.pyeval(name.'.locked') | |
332 : $put =toput | |
333 :endfor | |
334 :silent! call extend(l, [0]) | |
335 :silent! call extend(ll, [0]) | |
336 :py l.locked=True | |
337 :py ll.locked=False | |
338 :silent! call extend(l, [1]) | |
339 :silent! call extend(ll, [1]) | |
340 :put ='l:'.string(l) | |
341 :put ='ll:'.string(ll) | |
342 :unlet l ll | |
3618 | 343 :" |
344 :" pyeval() | |
345 :let l=pyeval('range(3)') | |
346 :$put =string(l) | |
347 :let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}') | |
348 :$put =sort(items(d)) | |
7660
066ef357ea91
commit https://github.com/vim/vim/commit/77324fc9d3206a12f5ae39da1574be3ee1273591
Christian Brabandt <cb@256bit.org>
parents:
7376
diff
changeset
|
349 :let v:errmsg = '' |
066ef357ea91
commit https://github.com/vim/vim/commit/77324fc9d3206a12f5ae39da1574be3ee1273591
Christian Brabandt <cb@256bit.org>
parents:
7376
diff
changeset
|
350 :$put ='pyeval(\"None\") = ' . pyeval('None') . v:errmsg |
3618 | 351 :if has('float') |
352 : let f=pyeval('0.0') | |
353 : $put =string(f) | |
354 :else | |
355 : $put ='0.0' | |
356 :endif | |
3802 | 357 :" Invalid values: |
358 :for e in ['"\0"', '{"\0": 1}', 'undefined_name', 'vim'] | |
359 : try | |
360 : let v=pyeval(e) | |
361 : catch | |
362 : let toput=e.":\t".v:exception[:13] | |
363 : $put =toput | |
364 : endtry | |
365 :endfor | |
4109 | 366 :" |
367 :" threading | |
368 :let l = [0] | |
369 :py l=vim.bindeval('l') | |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
370 py <<EOF |
4109 | 371 import threading |
372 import time | |
373 | |
374 class T(threading.Thread): | |
375 def __init__(self): | |
376 threading.Thread.__init__(self) | |
377 self.t = 0 | |
378 self.running = True | |
379 | |
380 def run(self): | |
381 while self.running: | |
382 self.t += 1 | |
383 time.sleep(0.1) | |
384 | |
385 t = T() | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
386 del T |
4109 | 387 t.start() |
388 EOF | |
389 :sleep 1 | |
390 :py t.running = False | |
391 :py t.join() | |
7376
88843d12c82b
commit https://github.com/vim/vim/commit/52f6ae1366b34fc5771595c0bd17c779a7f6f544
Christian Brabandt <cb@256bit.org>
parents:
7326
diff
changeset
|
392 :" Check if the background thread is working. Count should be 10, but on a |
88843d12c82b
commit https://github.com/vim/vim/commit/52f6ae1366b34fc5771595c0bd17c779a7f6f544
Christian Brabandt <cb@256bit.org>
parents:
7326
diff
changeset
|
393 :" busy system (AppVeyor) it can be much lower. |
88843d12c82b
commit https://github.com/vim/vim/commit/52f6ae1366b34fc5771595c0bd17c779a7f6f544
Christian Brabandt <cb@256bit.org>
parents:
7326
diff
changeset
|
394 :py l[0] = t.t > 4 |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
395 :py del time |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
396 :py del threading |
5517 | 397 :py del t |
4109 | 398 :$put =string(l) |
399 :" | |
400 :" settrace | |
401 :let l = [] | |
402 :py l=vim.bindeval('l') | |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
403 py <<EOF |
4109 | 404 import sys |
405 | |
406 def traceit(frame, event, arg): | |
407 global l | |
408 if event == "line": | |
409 l.extend([frame.f_lineno]) | |
410 return traceit | |
411 | |
412 def trace_main(): | |
413 for i in range(5): | |
414 pass | |
415 EOF | |
416 :py sys.settrace(traceit) | |
417 :py trace_main() | |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
418 :py sys.settrace(None) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
419 :py del traceit |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
420 :py del trace_main |
4109 | 421 :$put =string(l) |
4260 | 422 :" |
423 :" Slice | |
424 :py ll = vim.bindeval('[0, 1, 2, 3, 4, 5]') | |
425 :py l = ll[:4] | |
426 :$put =string(pyeval('l')) | |
427 :py l = ll[2:] | |
428 :$put =string(pyeval('l')) | |
429 :py l = ll[:-4] | |
430 :$put =string(pyeval('l')) | |
431 :py l = ll[-2:] | |
432 :$put =string(pyeval('l')) | |
433 :py l = ll[2:4] | |
434 :$put =string(pyeval('l')) | |
435 :py l = ll[4:2] | |
436 :$put =string(pyeval('l')) | |
437 :py l = ll[-4:-2] | |
438 :$put =string(pyeval('l')) | |
439 :py l = ll[-2:-4] | |
440 :$put =string(pyeval('l')) | |
441 :py l = ll[:] | |
442 :$put =string(pyeval('l')) | |
443 :py l = ll[0:6] | |
444 :$put =string(pyeval('l')) | |
445 :py l = ll[-10:10] | |
446 :$put =string(pyeval('l')) | |
5608 | 447 :py l = ll[4:2:-1] |
448 :$put =string(pyeval('l')) | |
449 :py l = ll[::2] | |
450 :$put =string(pyeval('l')) | |
451 :py l = ll[4:2:1] | |
452 :$put =string(pyeval('l')) | |
453 :py del l | |
4323 | 454 :" |
455 :" Vars | |
456 :let g:foo = 'bac' | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
457 :let w:abc3 = 'def' |
4323 | 458 :let b:baz = 'bar' |
4413 | 459 :let t:bar = 'jkl' |
4323 | 460 :try |
461 : throw "Abc" | |
462 :catch | |
463 : put =pyeval('vim.vvars[''exception'']') | |
464 :endtry | |
465 :put =pyeval('vim.vars[''foo'']') | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
466 :put =pyeval('vim.current.window.vars[''abc3'']') |
4323 | 467 :put =pyeval('vim.current.buffer.vars[''baz'']') |
4413 | 468 :put =pyeval('vim.current.tabpage.vars[''bar'']') |
4350 | 469 :" |
470 :" Options | |
471 :" paste: boolean, global | |
472 :" previewheight number, global | |
473 :" operatorfunc: string, global | |
474 :" number: boolean, window-local | |
475 :" numberwidth: number, window-local | |
476 :" colorcolumn: string, window-local | |
477 :" statusline: string, window-local/global | |
478 :" autoindent: boolean, buffer-local | |
4427 | 479 :" shiftwidth: number, buffer-local |
4350 | 480 :" omnifunc: string, buffer-local |
481 :" preserveindent: boolean, buffer-local/global | |
482 :" path: string, buffer-local/global | |
483 :let g:bufs=[bufnr('%')] | |
484 :new | |
485 :let g:bufs+=[bufnr('%')] | |
486 :vnew | |
487 :let g:bufs+=[bufnr('%')] | |
488 :wincmd j | |
489 :vnew | |
490 :let g:bufs+=[bufnr('%')] | |
491 :wincmd l | |
492 :fun RecVars(opt) | |
493 : let gval =string(eval('&g:'.a:opt)) | |
494 : let wvals=join(map(range(1, 4), 'v:val.":".string(getwinvar(v:val, "&".a:opt))')) | |
495 : let bvals=join(map(copy(g:bufs), 'v:val.":".string(getbufvar(v:val, "&".a:opt))')) | |
496 : put =' G: '.gval | |
497 : put =' W: '.wvals | |
498 : put =' B: '.wvals | |
499 :endfun | |
500 py << EOF | |
501 def e(s, g=globals(), l=locals()): | |
502 try: | |
503 exec(s, g, l) | |
4399 | 504 except: |
4498 | 505 vim.command('return ' + repr(sys.exc_type.__name__)) |
4350 | 506 |
507 def ev(s, g=globals(), l=locals()): | |
508 try: | |
509 return eval(s, g, l) | |
4399 | 510 except: |
4498 | 511 vim.command('let exc=' + repr(sys.exc_type.__name__)) |
4350 | 512 return 0 |
513 EOF | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
514 :fun E(s) |
4350 | 515 : python e(vim.eval('a:s')) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
516 :endfun |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
517 :fun Ev(s) |
4498 | 518 : let r=pyeval('ev(vim.eval("a:s"))') |
519 : if exists('exc') | |
520 : throw exc | |
521 : endif | |
522 : return r | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
523 :endfun |
4350 | 524 :py gopts1=vim.options |
525 :py wopts1=vim.windows[2].options | |
526 :py wopts2=vim.windows[0].options | |
527 :py wopts3=vim.windows[1].options | |
528 :py bopts1=vim.buffers[vim.bindeval("g:bufs")[2]].options | |
529 :py bopts2=vim.buffers[vim.bindeval("g:bufs")[1]].options | |
530 :py bopts3=vim.buffers[vim.bindeval("g:bufs")[0]].options | |
5610 | 531 :$put ='wopts iters equal: '.pyeval('list(wopts1) == list(wopts2)') |
532 :$put ='bopts iters equal: '.pyeval('list(bopts1) == list(bopts2)') | |
533 :py gset=set(iter(gopts1)) | |
534 :py wset=set(iter(wopts1)) | |
535 :py bset=set(iter(bopts1)) | |
4684
79522bb17125
updated for version 7.3.1089
Bram Moolenaar <bram@vim.org>
parents:
4665
diff
changeset
|
536 :set path=.,..,, |
4350 | 537 :let lst=[] |
538 :let lst+=[['paste', 1, 0, 1, 2, 1, 1, 0 ]] | |
539 :let lst+=[['previewheight', 5, 1, 6, 'a', 0, 1, 0 ]] | |
540 :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]] | |
541 :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]] | |
542 :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]] | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
543 :let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc4', 0, 0, 1 ]] |
4350 | 544 :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]] |
545 :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]] | |
4427 | 546 :let lst+=[['shiftwidth', 0, 2, 1, 3, 0, 0, 2 ]] |
4350 | 547 :let lst+=[['omnifunc', 'A', 'B', 'C', 1, 0, 0, 2 ]] |
548 :let lst+=[['preserveindent', 0, 1, 1, 2, 1, 1, 2 ]] | |
549 :let lst+=[['path', '.,,', ',,', '.', 0, 0, 1, 2 ]] | |
550 :for [oname, oval1, oval2, oval3, invval, bool, global, local] in lst | |
551 : py oname=vim.eval('oname') | |
552 : py oval1=vim.bindeval('oval1') | |
553 : py oval2=vim.bindeval('oval2') | |
554 : py oval3=vim.bindeval('oval3') | |
555 : if invval is 0 || invval is 1 | |
556 : py invval=bool(vim.bindeval('invval')) | |
557 : else | |
558 : py invval=vim.bindeval('invval') | |
559 : endif | |
560 : if bool | |
561 : py oval1=bool(oval1) | |
562 : py oval2=bool(oval2) | |
563 : py oval3=bool(oval3) | |
564 : endif | |
565 : put ='>>> '.oname | |
5610 | 566 : $put =' g/w/b:'.pyeval('oname in gset').'/'.pyeval('oname in wset').'/'.pyeval('oname in bset') |
567 : $put =' g/w/b (in):'.pyeval('oname in gopts1').'/'.pyeval('oname in wopts1').'/'.pyeval('oname in bopts1') | |
4350 | 568 : for v in ['gopts1', 'wopts1', 'bopts1'] |
569 : try | |
570 : put =' p/'.v.': '.Ev('repr('.v.'['''.oname.'''])') | |
571 : catch | |
572 : put =' p/'.v.'! '.v:exception | |
573 : endtry | |
4498 | 574 : let r=E(v.'['''.oname.''']=invval') |
575 : if r isnot 0 | |
576 : put =' inv: '.string(invval).'! '.r | |
577 : endif | |
4350 | 578 : for vv in (v is# 'gopts1' ? [v] : [v, v[:-2].'2', v[:-2].'3']) |
579 : let val=substitute(vv, '^.opts', 'oval', '') | |
4498 | 580 : let r=E(vv.'['''.oname.''']='.val) |
581 : if r isnot 0 | |
582 : put =' '.vv.'! '.r | |
583 : endif | |
4350 | 584 : endfor |
585 : endfor | |
586 : call RecVars(oname) | |
587 : for v in ['wopts3', 'bopts3'] | |
4498 | 588 : let r=E('del '.v.'["'.oname.'"]') |
589 : if r isnot 0 | |
590 : put =' del '.v.'! '.r | |
591 : endif | |
4350 | 592 : endfor |
593 : call RecVars(oname) | |
594 :endfor | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
595 :delfunction RecVars |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
596 :delfunction E |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
597 :delfunction Ev |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
598 :py del ev |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
599 :py del e |
4350 | 600 :only |
4397 | 601 :for buf in g:bufs[1:] |
602 : execute 'bwipeout!' buf | |
603 :endfor | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
604 :py del gopts1 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
605 :py del wopts1 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
606 :py del wopts2 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
607 :py del wopts3 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
608 :py del bopts1 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
609 :py del bopts2 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
610 :py del bopts3 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
611 :py del oval1 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
612 :py del oval2 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
613 :py del oval3 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
614 :py del oname |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
615 :py del invval |
4389 | 616 :" |
617 :" Test buffer object | |
618 :vnew | |
619 :put ='First line' | |
620 :put ='Second line' | |
621 :put ='Third line' | |
622 :1 delete _ | |
623 :py b=vim.current.buffer | |
624 :wincmd w | |
625 :mark a | |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
626 :augroup BUFS |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
627 : autocmd BufFilePost * python cb.append(vim.eval('expand("<abuf>")') + ':BufFilePost:' + vim.eval('bufnr("%")')) |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
628 : autocmd BufFilePre * python cb.append(vim.eval('expand("<abuf>")') + ':BufFilePre:' + vim.eval('bufnr("%")')) |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
629 :augroup END |
4389 | 630 py << EOF |
631 # Tests BufferAppend and BufferItem | |
632 cb.append(b[0]) | |
633 # Tests BufferSlice and BufferAssSlice | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
634 cb.append('abc5') # Will be overwritten |
4389 | 635 cb[-1:] = b[:-2] |
636 # Test BufferLength and BufferAssSlice | |
637 cb.append('def') # Will not be overwritten | |
638 cb[len(cb):] = b[:] | |
639 # Test BufferAssItem and BufferMark | |
640 cb.append('ghi') # Will be overwritten | |
641 cb[-1] = repr((len(cb) - cb.mark('a')[0], cb.mark('a')[1])) | |
642 # Test BufferRepr | |
643 cb.append(repr(cb) + repr(b)) | |
644 # Modify foreign buffer | |
645 b.append('foo') | |
646 b[0]='bar' | |
647 b[0:0]=['baz'] | |
648 vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) | |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
649 # Test assigning to name property |
4684
79522bb17125
updated for version 7.3.1089
Bram Moolenaar <bram@vim.org>
parents:
4665
diff
changeset
|
650 import os |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
651 old_name = cb.name |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
652 cb.name = 'foo' |
4684
79522bb17125
updated for version 7.3.1089
Bram Moolenaar <bram@vim.org>
parents:
4665
diff
changeset
|
653 cb.append(cb.name[-11:].replace(os.path.sep, '/')) |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
654 b.name = 'bar' |
4684
79522bb17125
updated for version 7.3.1089
Bram Moolenaar <bram@vim.org>
parents:
4665
diff
changeset
|
655 cb.append(b.name[-11:].replace(os.path.sep, '/')) |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
656 cb.name = old_name |
4684
79522bb17125
updated for version 7.3.1089
Bram Moolenaar <bram@vim.org>
parents:
4665
diff
changeset
|
657 cb.append(cb.name[-17:].replace(os.path.sep, '/')) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
658 del old_name |
4389 | 659 # Test CheckBuffer |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
660 for _b in vim.buffers: |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
661 if _b is not cb: |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
662 vim.command('bwipeout! ' + str(_b.number)) |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
663 del _b |
4593
0cf552b325b5
updated for version 7.3.1044
Bram Moolenaar <bram@vim.org>
parents:
4589
diff
changeset
|
664 cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid))) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
665 for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc6")', 'b.name = "!"'): |
4389 | 666 try: |
667 exec(expr) | |
668 except vim.error: | |
669 pass | |
670 else: | |
671 # Usually a SEGV here | |
672 # Should not happen in any case | |
673 cb.append('No exception for ' + expr) | |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
674 vim.command('cd .') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
675 del b |
4389 | 676 EOF |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
677 :augroup BUFS |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
678 : autocmd! |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
679 :augroup END |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
680 :augroup! BUFS |
4397 | 681 :" |
682 :" Test vim.buffers object | |
683 :set hidden | |
684 :edit a | |
685 :buffer # | |
686 :edit b | |
687 :buffer # | |
688 :edit c | |
689 :buffer # | |
690 py << EOF | |
4511
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
691 try: |
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
692 from __builtin__ import next |
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
693 except ImportError: |
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
694 next = lambda o: o.next() |
4397 | 695 # Check GCing iterator that was not fully exhausted |
696 i = iter(vim.buffers) | |
697 cb.append('i:' + str(next(i))) | |
5700 | 698 # and also check creating more than one iterator at a time |
4397 | 699 i2 = iter(vim.buffers) |
700 cb.append('i2:' + str(next(i2))) | |
701 cb.append('i:' + str(next(i))) | |
702 # The following should trigger GC and not cause any problems | |
703 del i | |
704 del i2 | |
705 i3 = iter(vim.buffers) | |
706 cb.append('i3:' + str(next(i3))) | |
707 del i3 | |
708 | |
709 prevnum = 0 | |
710 for b in vim.buffers: | |
711 # Check buffer order | |
712 if prevnum >= b.number: | |
713 cb.append('!!! Buffer numbers not in strictly ascending order') | |
714 # Check indexing: vim.buffers[number].number == number | |
715 cb.append(str(b.number) + ':' + repr(vim.buffers[b.number]) + '=' + repr(b)) | |
716 prevnum = b.number | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
717 del prevnum |
4397 | 718 |
719 cb.append(str(len(vim.buffers))) | |
720 | |
721 bnums = list(map(lambda b: b.number, vim.buffers))[1:] | |
722 | |
723 # Test wiping out buffer with existing iterator | |
724 i4 = iter(vim.buffers) | |
725 cb.append('i4:' + str(next(i4))) | |
726 vim.command('bwipeout! ' + str(bnums.pop(0))) | |
727 try: | |
728 next(i4) | |
729 except vim.error: | |
730 pass | |
731 else: | |
732 cb.append('!!!! No vim.error') | |
733 i4 = iter(vim.buffers) | |
734 vim.command('bwipeout! ' + str(bnums.pop(-1))) | |
735 vim.command('bwipeout! ' + str(bnums.pop(-1))) | |
736 cb.append('i4:' + str(next(i4))) | |
737 try: | |
738 next(i4) | |
739 except StopIteration: | |
740 cb.append('StopIteration') | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
741 del i4 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
742 del bnums |
4397 | 743 EOF |
4413 | 744 :" |
745 :" Test vim.{tabpage,window}list and vim.{tabpage,window} objects | |
746 :tabnew 0 | |
747 :tabnew 1 | |
748 :vnew a.1 | |
749 :tabnew 2 | |
750 :vnew a.2 | |
751 :vnew b.2 | |
752 :vnew c.2 | |
753 py << EOF | |
754 cb.append('Number of tabs: ' + str(len(vim.tabpages))) | |
755 cb.append('Current tab pages:') | |
756 def W(w): | |
4511
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
757 if repr(w).find('(unknown)') != -1: |
4413 | 758 return '<window object (unknown)>' |
759 else: | |
760 return repr(w) | |
4511
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
761 |
4589
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
762 start = len(cb) |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
763 |
fa39483a1363
updated for version 7.3.1042
Bram Moolenaar <bram@vim.org>
parents:
4511
diff
changeset
|
764 def Cursor(w): |
4511
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
765 if w.buffer is cb: |
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
766 return repr((start - w.cursor[0], w.cursor[1])) |
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
767 else: |
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
768 return repr(w.cursor) |
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
769 |
4413 | 770 for t in vim.tabpages: |
771 cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window)) | |
772 cb.append(' Windows:') | |
773 for w in t.windows: | |
4511
ce94a870b59b
updated for version 7.3.1003
Bram Moolenaar <bram@vim.org>
parents:
4498
diff
changeset
|
774 cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w)) |
4413 | 775 # Other values depend on the size of the terminal, so they are checked partly: |
776 for attr in ('height', 'row', 'width', 'col'): | |
777 try: | |
778 aval = getattr(w, attr) | |
779 if type(aval) is not long: | |
780 raise TypeError | |
781 if aval < 0: | |
782 raise ValueError | |
783 except Exception: | |
784 cb.append('!!!!!! Error while getting attribute ' + attr + ': ' + sys.exc_type.__name__) | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
785 del aval |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
786 del attr |
4413 | 787 w.cursor = (len(w.buffer), 0) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
788 del W |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
789 del Cursor |
4413 | 790 cb.append('Number of windows in current tab page: ' + str(len(vim.windows))) |
791 if list(vim.windows) != list(vim.current.tabpage.windows): | |
792 cb.append('!!!!!! Windows differ') | |
793 EOF | |
794 :" | |
795 :" Test vim.current | |
796 py << EOF | |
797 def H(o): | |
798 return repr(o) | |
799 cb.append('Current tab page: ' + repr(vim.current.tabpage)) | |
800 cb.append('Current window: ' + repr(vim.current.window) + ': ' + H(vim.current.window) + ' is ' + H(vim.current.tabpage.window)) | |
801 cb.append('Current buffer: ' + repr(vim.current.buffer) + ': ' + H(vim.current.buffer) + ' is ' + H(vim.current.window.buffer)+ ' is ' + H(vim.current.tabpage.window.buffer)) | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
802 del H |
4413 | 803 # Assigning: fails |
804 try: | |
805 vim.current.window = vim.tabpages[0].window | |
806 except ValueError: | |
807 cb.append('ValueError at assigning foreign tab window') | |
808 | |
809 for attr in ('window', 'tabpage', 'buffer'): | |
810 try: | |
811 setattr(vim.current, attr, None) | |
812 except TypeError: | |
813 cb.append('Type error at assigning None to vim.current.' + attr) | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
814 del attr |
4413 | 815 |
816 # Assigning: success | |
817 vim.current.tabpage = vim.tabpages[-2] | |
818 vim.current.buffer = cb | |
819 vim.current.window = vim.windows[0] | |
820 vim.current.window.cursor = (len(vim.current.buffer), 0) | |
821 cb.append('Current tab page: ' + repr(vim.current.tabpage)) | |
822 cb.append('Current window: ' + repr(vim.current.window)) | |
823 cb.append('Current buffer: ' + repr(vim.current.buffer)) | |
824 cb.append('Current line: ' + repr(vim.current.line)) | |
4593
0cf552b325b5
updated for version 7.3.1044
Bram Moolenaar <bram@vim.org>
parents:
4589
diff
changeset
|
825 ws = list(vim.windows) |
0cf552b325b5
updated for version 7.3.1044
Bram Moolenaar <bram@vim.org>
parents:
4589
diff
changeset
|
826 ts = list(vim.tabpages) |
4413 | 827 for b in vim.buffers: |
828 if b is not cb: | |
4496 | 829 vim.command('bwipeout! ' + str(b.number)) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
830 del b |
4593
0cf552b325b5
updated for version 7.3.1044
Bram Moolenaar <bram@vim.org>
parents:
4589
diff
changeset
|
831 cb.append('w.valid: ' + repr([w.valid for w in ws])) |
0cf552b325b5
updated for version 7.3.1044
Bram Moolenaar <bram@vim.org>
parents:
4589
diff
changeset
|
832 cb.append('t.valid: ' + repr([t.valid for t in ts])) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
833 del w |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
834 del t |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
835 del ts |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
836 del ws |
4413 | 837 EOF |
838 :tabonly! | |
839 :only! | |
4496 | 840 :" |
841 :" Test types | |
842 py << EOF | |
843 for expr, attr in ( | |
844 ('vim.vars', 'Dictionary'), | |
845 ('vim.options', 'Options'), | |
846 ('vim.bindeval("{}")', 'Dictionary'), | |
847 ('vim.bindeval("[]")', 'List'), | |
848 ('vim.bindeval("function(\'tr\')")', 'Function'), | |
849 ('vim.current.buffer', 'Buffer'), | |
850 ('vim.current.range', 'Range'), | |
851 ('vim.current.window', 'Window'), | |
852 ('vim.current.tabpage', 'TabPage'), | |
853 ): | |
854 cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr))) | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
855 del expr |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
856 del attr |
4496 | 857 EOF |
4498 | 858 :" |
4599
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
859 :" Test __dir__() method |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
860 py << EOF |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
861 for name, o in ( |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
862 ('current', vim.current), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
863 ('buffer', vim.current.buffer), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
864 ('window', vim.current.window), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
865 ('tabpage', vim.current.tabpage), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
866 ('range', vim.current.range), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
867 ('dictionary', vim.bindeval('{}')), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
868 ('list', vim.bindeval('[]')), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
869 ('function', vim.bindeval('function("tr")')), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
870 ('output', sys.stdout), |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
871 ): |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
872 cb.append(name + ':' + ','.join(dir(o))) |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
873 del name |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
874 del o |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
875 EOF |
89bec74fd793
updated for version 7.3.1047
Bram Moolenaar <bram@vim.org>
parents:
4593
diff
changeset
|
876 :" |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
877 :" Test vim.*.__new__ |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
878 :$put =string(pyeval('vim.Dictionary({})')) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
879 :$put =string(pyeval('vim.Dictionary(a=1)')) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
880 :$put =string(pyeval('vim.Dictionary(((''a'', 1),))')) |
4629
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
881 :$put =string(pyeval('vim.List()')) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
882 :$put =string(pyeval('vim.List(iter(''abc7''))')) |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
883 :$put =string(pyeval('vim.Function(''tr'')')) |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
884 :$put =string(pyeval('vim.Function(''tr'', args=[123, 3, 4])')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
885 :$put =string(pyeval('vim.Function(''tr'', args=[])')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
886 :$put =string(pyeval('vim.Function(''tr'', self={})')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
887 :$put =string(pyeval('vim.Function(''tr'', args=[123, 3, 4], self={})')) |
9119
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
888 :$put ='auto_rebind' |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
889 :$put =string(pyeval('vim.Function(''tr'', auto_rebind=False)')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
890 :$put =string(pyeval('vim.Function(''tr'', args=[123, 3, 4], auto_rebind=False)')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
891 :$put =string(pyeval('vim.Function(''tr'', args=[], auto_rebind=False)')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
892 :$put =string(pyeval('vim.Function(''tr'', self={}, auto_rebind=False)')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
893 :$put =string(pyeval('vim.Function(''tr'', args=[123, 3, 4], self={}, auto_rebind=False)')) |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
894 :" |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
895 :" Test vim.Function |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
896 :function Args(...) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
897 : return a:000 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
898 :endfunction |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
899 :function SelfArgs(...) dict |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
900 : return [a:000, self] |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
901 :endfunction |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
902 :" The following four lines should not crash |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
903 :let Pt = function('tr', [[]], {'l': []}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
904 :py Pt = vim.bindeval('Pt') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
905 :unlet Pt |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
906 :py del Pt |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
907 py << EOF |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
908 def ecall(out_prefix, func, *args, **kwargs): |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
909 line = out_prefix + ': ' |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
910 try: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
911 ret = func(*args, **kwargs) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
912 except Exception: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
913 line += '!exception: ' + emsg(sys.exc_info()) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
914 else: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
915 line += '!result: ' + vim.Function('string')(ret) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
916 cb.append(line) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
917 a = vim.Function('Args') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
918 pa1 = vim.Function('Args', args=['abcArgsPA1']) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
919 pa2 = vim.Function('Args', args=[]) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
920 pa3 = vim.Function('Args', args=['abcArgsPA3'], self={'abcSelfPA3': 'abcSelfPA3Val'}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
921 pa4 = vim.Function('Args', self={'abcSelfPA4': 'abcSelfPA4Val'}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
922 cb.append('a: ' + repr(a)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
923 cb.append('pa1: ' + repr(pa1)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
924 cb.append('pa2: ' + repr(pa2)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
925 cb.append('pa3: ' + repr(pa3)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
926 cb.append('pa4: ' + repr(pa4)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
927 sa = vim.Function('SelfArgs') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
928 psa1 = vim.Function('SelfArgs', args=['abcArgsPSA1']) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
929 psa2 = vim.Function('SelfArgs', args=[]) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
930 psa3 = vim.Function('SelfArgs', args=['abcArgsPSA3'], self={'abcSelfPSA3': 'abcSelfPSA3Val'}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
931 psa4 = vim.Function('SelfArgs', self={'abcSelfPSA4': 'abcSelfPSA4Val'}) |
9119
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
932 psa5 = vim.Function('SelfArgs', self={'abcSelfPSA5': 'abcSelfPSA5Val'}, auto_rebind=0) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
933 psa6 = vim.Function('SelfArgs', args=['abcArgsPSA6'], self={'abcSelfPSA6': 'abcSelfPSA6Val'}, auto_rebind=()) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
934 psa7 = vim.Function('SelfArgs', args=['abcArgsPSA7'], auto_rebind=[]) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
935 psa8 = vim.Function('SelfArgs', auto_rebind=False) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
936 psa9 = vim.Function('SelfArgs', self={'abcSelfPSA9': 'abcSelfPSA9Val'}, auto_rebind=True) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
937 psaA = vim.Function('SelfArgs', args=['abcArgsPSAA'], self={'abcSelfPSAA': 'abcSelfPSAAVal'}, auto_rebind=1) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
938 psaB = vim.Function('SelfArgs', args=['abcArgsPSAB'], auto_rebind={'abcARPSAB': 'abcARPSABVal'}) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
939 psaC = vim.Function('SelfArgs', auto_rebind=['abcARPSAC']) |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
940 cb.append('sa: ' + repr(sa)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
941 cb.append('psa1: ' + repr(psa1)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
942 cb.append('psa2: ' + repr(psa2)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
943 cb.append('psa3: ' + repr(psa3)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
944 cb.append('psa4: ' + repr(psa4)) |
9119
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
945 cb.append('psa5: ' + repr(psa5)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
946 cb.append('psa6: ' + repr(psa6)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
947 cb.append('psa7: ' + repr(psa7)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
948 cb.append('psa8: ' + repr(psa8)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
949 cb.append('psa9: ' + repr(psa9)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
950 cb.append('psaA: ' + repr(psaA)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
951 cb.append('psaB: ' + repr(psaB)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
952 cb.append('psaC: ' + repr(psaC)) |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
953 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
954 psar = vim.Function('SelfArgs', args=[{'abcArgsPSAr': 'abcArgsPSArVal'}], self={'abcSelfPSAr': 'abcSelfPSArVal'}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
955 psar.args[0]['abcArgsPSAr2'] = [psar.self, psar.args[0]] |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
956 psar.self['rec'] = psar |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
957 psar.self['self'] = psar.self |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
958 psar.self['args'] = psar.args |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
959 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
960 try: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
961 cb.append('psar: ' + repr(psar)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
962 except Exception: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
963 cb.append('!!!!!!!! Caught exception: ' + emsg(sys.exc_info())) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
964 EOF |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
965 :$put ='s(a): '.string(pyeval('a')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
966 :$put ='s(pa1): '.string(pyeval('pa1')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
967 :$put ='s(pa2): '.string(pyeval('pa2')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
968 :$put ='s(pa3): '.string(pyeval('pa3')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
969 :$put ='s(pa4): '.string(pyeval('pa4')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
970 :$put ='s(sa): '.string(pyeval('sa')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
971 :$put ='s(psa1): '.string(pyeval('psa1')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
972 :$put ='s(psa2): '.string(pyeval('psa2')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
973 :$put ='s(psa3): '.string(pyeval('psa3')) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
974 :$put ='s(psa4): '.string(pyeval('psa4')) |
9119
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
975 :$put ='s(psa5): '.string(pyeval('psa5')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
976 :$put ='s(psa6): '.string(pyeval('psa6')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
977 :$put ='s(psa7): '.string(pyeval('psa7')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
978 :$put ='s(psa8): '.string(pyeval('psa8')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
979 :$put ='s(psa9): '.string(pyeval('psa9')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
980 :$put ='s(psaA): '.string(pyeval('psaA')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
981 :$put ='s(psaB): '.string(pyeval('psaB')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
982 :$put ='s(psaC): '.string(pyeval('psaC')) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
983 : |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
984 :for v in ['sa', 'psa1', 'psa2', 'psa3', 'psa4', 'psa5', 'psa6', 'psa7', 'psa8', 'psa9', 'psaA', 'psaB', 'psaC'] |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
985 : let d = {'f': pyeval(v)} |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
986 : $put ='d.'.v.'(): '.string(d.f()) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
987 :endfor |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
988 : |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
989 :py ecall('a()', a, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
990 :py ecall('pa1()', pa1, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
991 :py ecall('pa2()', pa2, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
992 :py ecall('pa3()', pa3, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
993 :py ecall('pa4()', pa4, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
994 :py ecall('sa()', sa, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
995 :py ecall('psa1()', psa1, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
996 :py ecall('psa2()', psa2, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
997 :py ecall('psa3()', psa3, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
998 :py ecall('psa4()', psa4, ) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
999 : |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1000 :py ecall('a(42, 43)', a, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1001 :py ecall('pa1(42, 43)', pa1, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1002 :py ecall('pa2(42, 43)', pa2, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1003 :py ecall('pa3(42, 43)', pa3, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1004 :py ecall('pa4(42, 43)', pa4, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1005 :py ecall('sa(42, 43)', sa, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1006 :py ecall('psa1(42, 43)', psa1, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1007 :py ecall('psa2(42, 43)', psa2, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1008 :py ecall('psa3(42, 43)', psa3, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1009 :py ecall('psa4(42, 43)', psa4, 42, 43) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1010 : |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1011 :py ecall('a(42, self={"20": 1})', a, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1012 :py ecall('pa1(42, self={"20": 1})', pa1, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1013 :py ecall('pa2(42, self={"20": 1})', pa2, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1014 :py ecall('pa3(42, self={"20": 1})', pa3, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1015 :py ecall('pa4(42, self={"20": 1})', pa4, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1016 :py ecall('sa(42, self={"20": 1})', sa, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1017 :py ecall('psa1(42, self={"20": 1})', psa1, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1018 :py ecall('psa2(42, self={"20": 1})', psa2, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1019 :py ecall('psa3(42, self={"20": 1})', psa3, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1020 :py ecall('psa4(42, self={"20": 1})', psa4, 42, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1021 : |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1022 :py ecall('a(self={"20": 1})', a, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1023 :py ecall('pa1(self={"20": 1})', pa1, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1024 :py ecall('pa2(self={"20": 1})', pa2, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1025 :py ecall('pa3(self={"20": 1})', pa3, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1026 :py ecall('pa4(self={"20": 1})', pa4, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1027 :py ecall('sa(self={"20": 1})', sa, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1028 :py ecall('psa1(self={"20": 1})', psa1, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1029 :py ecall('psa2(self={"20": 1})', psa2, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1030 :py ecall('psa3(self={"20": 1})', psa3, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1031 :py ecall('psa4(self={"20": 1})', psa4, self={'20': 1}) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1032 py << EOF |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1033 def s(v): |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1034 if v is None: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1035 return repr(v) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1036 else: |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1037 return vim.Function('string')(v) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1038 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1039 cb.append('a.args: ' + s(a.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1040 cb.append('pa1.args: ' + s(pa1.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1041 cb.append('pa2.args: ' + s(pa2.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1042 cb.append('pa3.args: ' + s(pa3.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1043 cb.append('pa4.args: ' + s(pa4.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1044 cb.append('sa.args: ' + s(sa.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1045 cb.append('psa1.args: ' + s(psa1.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1046 cb.append('psa2.args: ' + s(psa2.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1047 cb.append('psa3.args: ' + s(psa3.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1048 cb.append('psa4.args: ' + s(psa4.args)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1049 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1050 cb.append('a.self: ' + s(a.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1051 cb.append('pa1.self: ' + s(pa1.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1052 cb.append('pa2.self: ' + s(pa2.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1053 cb.append('pa3.self: ' + s(pa3.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1054 cb.append('pa4.self: ' + s(pa4.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1055 cb.append('sa.self: ' + s(sa.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1056 cb.append('psa1.self: ' + s(psa1.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1057 cb.append('psa2.self: ' + s(psa2.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1058 cb.append('psa3.self: ' + s(psa3.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1059 cb.append('psa4.self: ' + s(psa4.self)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1060 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1061 cb.append('a.name: ' + s(a.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1062 cb.append('pa1.name: ' + s(pa1.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1063 cb.append('pa2.name: ' + s(pa2.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1064 cb.append('pa3.name: ' + s(pa3.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1065 cb.append('pa4.name: ' + s(pa4.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1066 cb.append('sa.name: ' + s(sa.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1067 cb.append('psa1.name: ' + s(psa1.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1068 cb.append('psa2.name: ' + s(psa2.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1069 cb.append('psa3.name: ' + s(psa3.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1070 cb.append('psa4.name: ' + s(psa4.name)) |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1071 |
9119
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1072 cb.append('a.auto_rebind: ' + s(a.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1073 cb.append('pa1.auto_rebind: ' + s(pa1.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1074 cb.append('pa2.auto_rebind: ' + s(pa2.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1075 cb.append('pa3.auto_rebind: ' + s(pa3.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1076 cb.append('pa4.auto_rebind: ' + s(pa4.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1077 cb.append('sa.auto_rebind: ' + s(sa.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1078 cb.append('psa1.auto_rebind: ' + s(psa1.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1079 cb.append('psa2.auto_rebind: ' + s(psa2.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1080 cb.append('psa3.auto_rebind: ' + s(psa3.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1081 cb.append('psa4.auto_rebind: ' + s(psa4.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1082 cb.append('psa5.auto_rebind: ' + s(psa5.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1083 cb.append('psa6.auto_rebind: ' + s(psa6.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1084 cb.append('psa7.auto_rebind: ' + s(psa7.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1085 cb.append('psa8.auto_rebind: ' + s(psa8.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1086 cb.append('psa9.auto_rebind: ' + s(psa9.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1087 cb.append('psaA.auto_rebind: ' + s(psaA.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1088 cb.append('psaB.auto_rebind: ' + s(psaB.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1089 cb.append('psaC.auto_rebind: ' + s(psaC.auto_rebind)) |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1090 |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1091 del s |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1092 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1093 del a |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1094 del pa1 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1095 del pa2 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1096 del pa3 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1097 del pa4 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1098 del sa |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1099 del psa1 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1100 del psa2 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1101 del psa3 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1102 del psa4 |
9119
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1103 del psa5 |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1104 del psa6 |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1105 del psa7 |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1106 del psa8 |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1107 del psa9 |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1108 del psaA |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1109 del psaB |
39cc63e8df7c
commit https://github.com/vim/vim/commit/2177f9fe18a927ef65ccebb0856722a28dc00252
Christian Brabandt <cb@256bit.org>
parents:
8967
diff
changeset
|
1110 del psaC |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1111 del psar |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1112 |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1113 del ecall |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1114 EOF |
4619
90beab957ba9
updated for version 7.3.1057
Bram Moolenaar <bram@vim.org>
parents:
4599
diff
changeset
|
1115 :" |
90beab957ba9
updated for version 7.3.1057
Bram Moolenaar <bram@vim.org>
parents:
4599
diff
changeset
|
1116 :" Test stdout/stderr |
90beab957ba9
updated for version 7.3.1057
Bram Moolenaar <bram@vim.org>
parents:
4599
diff
changeset
|
1117 :redir => messages |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1118 :py sys.stdout.write('abc8') ; sys.stdout.write('def') |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1119 :py sys.stderr.write('abc9') ; sys.stderr.write('def') |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1120 :py sys.stdout.writelines(iter('abcA')) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1121 :py sys.stderr.writelines(iter('abcB')) |
4619
90beab957ba9
updated for version 7.3.1057
Bram Moolenaar <bram@vim.org>
parents:
4599
diff
changeset
|
1122 :redir END |
90beab957ba9
updated for version 7.3.1057
Bram Moolenaar <bram@vim.org>
parents:
4599
diff
changeset
|
1123 :$put =string(substitute(messages, '\d\+', '', 'g')) |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1124 :" Test subclassing |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1125 :fun Put(...) |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1126 : $put =string(a:000) |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1127 : return a:000 |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1128 :endfun |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1129 py << EOF |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1130 class DupDict(vim.Dictionary): |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1131 def __setitem__(self, key, value): |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1132 super(DupDict, self).__setitem__(key, value) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1133 super(DupDict, self).__setitem__('dup_' + key, value) |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1134 dd = DupDict() |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1135 dd['a'] = 'b' |
4629
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1136 |
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1137 class DupList(vim.List): |
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1138 def __getitem__(self, idx): |
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1139 return [super(DupList, self).__getitem__(idx)] * 2 |
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1140 |
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1141 dl = DupList() |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1142 dl2 = DupList(iter('abcC')) |
4629
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1143 dl.extend(dl2[0]) |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1144 |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1145 class DupFun(vim.Function): |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1146 def __call__(self, arg): |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1147 return super(DupFun, self).__call__(arg, arg) |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1148 |
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1149 df = DupFun('Put') |
4627
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1150 EOF |
18ba89e06fab
updated for version 7.3.1061
Bram Moolenaar <bram@vim.org>
parents:
4619
diff
changeset
|
1151 :$put =string(sort(keys(pyeval('dd')))) |
4629
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1152 :$put =string(pyeval('dl')) |
e4e48d4ee040
updated for version 7.3.1062
Bram Moolenaar <bram@vim.org>
parents:
4627
diff
changeset
|
1153 :$put =string(pyeval('dl2')) |
4631
4157fef7b950
updated for version 7.3.1063
Bram Moolenaar <bram@vim.org>
parents:
4629
diff
changeset
|
1154 :$put =string(pyeval('df(2)')) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1155 :$put =string(pyeval('dl') is# pyeval('dl')) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1156 :$put =string(pyeval('dd') is# pyeval('dd')) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1157 :$put =string(pyeval('df')) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1158 :delfunction Put |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1159 py << EOF |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1160 del DupDict |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1161 del DupList |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1162 del DupFun |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1163 del dd |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1164 del dl |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1165 del dl2 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1166 del df |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1167 EOF |
4619
90beab957ba9
updated for version 7.3.1057
Bram Moolenaar <bram@vim.org>
parents:
4599
diff
changeset
|
1168 :" |
4704
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1169 :" Test chdir |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1170 py << EOF |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1171 import os |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1172 fnamemodify = vim.Function('fnamemodify') |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1173 cb.append(fnamemodify('.', ':p:h:t')) |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1174 cb.append(vim.eval('@%')) |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1175 os.chdir('..') |
5176
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1176 path = fnamemodify('.', ':p:h:t') |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1177 if path != 'src': |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1178 # Running tests from a shadow directory, so move up another level |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1179 # This will result in @% looking like shadow/testdir/test86.in, hence the |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1180 # extra fnamemodify |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1181 os.chdir('..') |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1182 cb.append(fnamemodify('.', ':p:h:t')) |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1183 cb.append(fnamemodify(vim.eval('@%'), ':s?^%s.??' % path).replace(os.path.sep, '/')) |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1184 os.chdir(path) |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1185 del path |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1186 else: |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1187 cb.append(fnamemodify('.', ':p:h:t')) |
08eb57382186
updated for version 7.4a.014
Bram Moolenaar <bram@vim.org>
parents:
5012
diff
changeset
|
1188 cb.append(vim.eval('@%').replace(os.path.sep, '/')) |
4704
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1189 os.chdir('testdir') |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1190 cb.append(fnamemodify('.', ':p:h:t')) |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1191 cb.append(vim.eval('@%')) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1192 del fnamemodify |
4704
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1193 EOF |
542af01979be
updated for version 7.3.1099
Bram Moolenaar <bram@vim.org>
parents:
4698
diff
changeset
|
1194 :" |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1195 :" Test errors |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1196 :fun F() dict |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1197 :endfun |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1198 :fun D() |
4498 | 1199 :endfun |
1200 py << EOF | |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1201 d = vim.Dictionary() |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1202 ned = vim.Dictionary(foo='bar', baz='abcD') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1203 dl = vim.Dictionary(a=1) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1204 dl.locked = True |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1205 l = vim.List() |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1206 ll = vim.List('abcE') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1207 ll.locked = True |
5608 | 1208 nel = vim.List('abcO') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1209 f = vim.Function('string') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1210 fd = vim.Function('F') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1211 fdel = vim.Function('D') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1212 vim.command('delfunction D') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1213 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1214 def subexpr_test(expr, name, subexprs): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1215 cb.append('>>> Testing %s using %s' % (name, expr)) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1216 for subexpr in subexprs: |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1217 ee(expr % subexpr) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1218 cb.append('<<< Finished') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1219 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1220 def stringtochars_test(expr): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1221 return subexpr_test(expr, 'StringToChars', ( |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1222 '1', # Fail type checks |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1223 'u"\\0"', # Fail PyString_AsStringAndSize(bytes, , NULL) check |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1224 '"\\0"', # Fail PyString_AsStringAndSize(object, , NULL) check |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1225 )) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1226 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1227 class Mapping(object): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1228 def __init__(self, d): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1229 self.d = d |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1230 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1231 def __getitem__(self, key): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1232 return self.d[key] |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1233 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1234 def keys(self): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1235 return self.d.keys() |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1236 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1237 def items(self): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1238 return self.d.items() |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1239 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1240 def convertfrompyobject_test(expr, recurse=True): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1241 # pydict_to_tv |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1242 stringtochars_test(expr % '{%s : 1}') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1243 if recurse: |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1244 convertfrompyobject_test(expr % '{"abcF" : %s}', False) |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1245 # pymap_to_tv |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1246 stringtochars_test(expr % 'Mapping({%s : 1})') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1247 if recurse: |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1248 convertfrompyobject_test(expr % 'Mapping({"abcG" : %s})', False) |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1249 # pyseq_to_tv |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1250 iter_test(expr) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1251 return subexpr_test(expr, 'ConvertFromPyObject', ( |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1252 'None', # Not conversible |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1253 '{"": 1}', # Empty key not allowed |
4706
bf917ee1fad2
updated for version 7.3.1100
Bram Moolenaar <bram@vim.org>
parents:
4704
diff
changeset
|
1254 '{u"": 1}', # Same, but with unicode object |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1255 'FailingMapping()', # |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1256 'FailingMappingKey()', # |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1257 'FailingNumber()', # |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1258 )) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1259 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1260 def convertfrompymapping_test(expr): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1261 convertfrompyobject_test(expr) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1262 return subexpr_test(expr, 'ConvertFromPyMapping', ( |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1263 '[]', |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1264 )) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1265 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1266 def iter_test(expr): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1267 return subexpr_test(expr, '*Iter*', ( |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1268 'FailingIter()', |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1269 'FailingIterNext()', |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1270 )) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1271 |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1272 def number_test(expr, natural=False, unsigned=False): |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1273 if natural: |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1274 unsigned = True |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1275 return subexpr_test(expr, 'NumberToLong', ( |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1276 '[]', |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1277 'None', |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1278 ) + (unsigned and ('-1',) or ()) |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1279 + (natural and ('0',) or ())) |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1280 |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1281 class FailingTrue(object): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1282 def __nonzero__(self): |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1283 raise NotImplementedError('bool') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1284 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1285 class FailingIter(object): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1286 def __iter__(self): |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1287 raise NotImplementedError('iter') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1288 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1289 class FailingIterNext(object): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1290 def __iter__(self): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1291 return self |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1292 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1293 def next(self): |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1294 raise NotImplementedError('next') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1295 |
5608 | 1296 class FailingIterNextN(object): |
1297 def __init__(self, n): | |
1298 self.n = n | |
1299 | |
1300 def __iter__(self): | |
1301 return self | |
1302 | |
1303 def next(self): | |
1304 if self.n: | |
1305 self.n -= 1 | |
1306 return 1 | |
1307 else: | |
1308 raise NotImplementedError('next N') | |
1309 | |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1310 class FailingMappingKey(object): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1311 def __getitem__(self, item): |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1312 raise NotImplementedError('getitem:mappingkey') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1313 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1314 def keys(self): |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1315 return list("abcH") |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1316 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1317 class FailingMapping(object): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1318 def __getitem__(self): |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1319 raise NotImplementedError('getitem:mapping') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1320 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1321 def keys(self): |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1322 raise NotImplementedError('keys') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1323 |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1324 class FailingList(list): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1325 def __getitem__(self, idx): |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1326 if i == 2: |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1327 raise NotImplementedError('getitem:list') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1328 else: |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1329 return super(FailingList, self).__getitem__(idx) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1330 |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1331 class NoArgsCall(object): |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1332 def __call__(self): |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1333 pass |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1334 |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1335 class FailingCall(object): |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1336 def __call__(self, path): |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1337 raise NotImplementedError('call') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1338 |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1339 class FailingNumber(object): |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1340 def __int__(self): |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1341 raise NotImplementedError('int') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1342 |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1343 cb.append("> Output") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1344 cb.append(">> OutputSetattr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1345 ee('del sys.stdout.softspace') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1346 number_test('sys.stdout.softspace = %s', unsigned=True) |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1347 number_test('sys.stderr.softspace = %s', unsigned=True) |
7191
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1348 ee('assert sys.stdout.isatty()==False') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1349 ee('assert sys.stdout.seekable()==False') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1350 ee('sys.stdout.close()') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1351 ee('sys.stdout.flush()') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1352 ee('assert sys.stderr.isatty()==False') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1353 ee('assert sys.stderr.seekable()==False') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1354 ee('sys.stderr.close()') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1355 ee('sys.stderr.flush()') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1356 ee('sys.stdout.attr = None') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1357 cb.append(">> OutputWrite") |
7191
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1358 ee('assert sys.stdout.writable()==True') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1359 ee('assert sys.stdout.readable()==False') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1360 ee('assert sys.stderr.writable()==True') |
692dac7183de
commit https://github.com/vim/vim/commit/d424747d5821c2873e24d25d3407d08b25ea3443
Christian Brabandt <cb@256bit.org>
parents:
6257
diff
changeset
|
1361 ee('assert sys.stderr.readable()==False') |
8967
df5f9284fcba
commit https://github.com/vim/vim/commit/6d4431e7b675ba7a0194c0b8eb84b7d92e4e7953
Christian Brabandt <cb@256bit.org>
parents:
8889
diff
changeset
|
1362 ee('assert sys.stdout.closed()==False') |
df5f9284fcba
commit https://github.com/vim/vim/commit/6d4431e7b675ba7a0194c0b8eb84b7d92e4e7953
Christian Brabandt <cb@256bit.org>
parents:
8889
diff
changeset
|
1363 ee('assert sys.stderr.closed()==False') |
df5f9284fcba
commit https://github.com/vim/vim/commit/6d4431e7b675ba7a0194c0b8eb84b7d92e4e7953
Christian Brabandt <cb@256bit.org>
parents:
8889
diff
changeset
|
1364 ee('assert sys.stdout.errors=="strict"') |
df5f9284fcba
commit https://github.com/vim/vim/commit/6d4431e7b675ba7a0194c0b8eb84b7d92e4e7953
Christian Brabandt <cb@256bit.org>
parents:
8889
diff
changeset
|
1365 ee('assert sys.stderr.errors=="strict"') |
df5f9284fcba
commit https://github.com/vim/vim/commit/6d4431e7b675ba7a0194c0b8eb84b7d92e4e7953
Christian Brabandt <cb@256bit.org>
parents:
8889
diff
changeset
|
1366 ee('assert sys.stdout.encoding==sys.stderr.encoding') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1367 ee('sys.stdout.write(None)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1368 cb.append(">> OutputWriteLines") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1369 ee('sys.stdout.writelines(None)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1370 ee('sys.stdout.writelines([1])') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1371 iter_test('sys.stdout.writelines(%s)') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1372 cb.append("> VimCommand") |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1373 stringtochars_test('vim.command(%s)') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1374 ee('vim.command("", 2)') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1375 #! Not checked: vim->python exceptions translating: checked later |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1376 cb.append("> VimToPython") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1377 #! Not checked: everything: needs errors in internal python functions |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1378 cb.append("> VimEval") |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1379 stringtochars_test('vim.eval(%s)') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1380 ee('vim.eval("", FailingTrue())') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1381 #! Not checked: everything: needs errors in internal python functions |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1382 cb.append("> VimEvalPy") |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1383 stringtochars_test('vim.bindeval(%s)') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1384 ee('vim.eval("", 2)') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1385 #! Not checked: vim->python exceptions translating: checked later |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1386 cb.append("> VimStrwidth") |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1387 stringtochars_test('vim.strwidth(%s)') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1388 cb.append("> VimForeachRTP") |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1389 ee('vim.foreach_rtp(None)') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1390 ee('vim.foreach_rtp(NoArgsCall())') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1391 ee('vim.foreach_rtp(FailingCall())') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1392 ee('vim.foreach_rtp(int, 2)') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1393 cb.append('> import') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1394 old_rtp = vim.options['rtp'] |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1395 vim.options['rtp'] = os.getcwd().replace('\\', '\\\\').replace(',', '\\,') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1396 ee('import xxx_no_such_module_xxx') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1397 ee('import failing_import') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1398 ee('import failing') |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1399 vim.options['rtp'] = old_rtp |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1400 del old_rtp |
5610 | 1401 cb.append("> Options") |
1402 cb.append(">> OptionsItem") | |
1403 ee('vim.options["abcQ"]') | |
1404 ee('vim.options[""]') | |
1405 stringtochars_test('vim.options[%s]') | |
1406 cb.append(">> OptionsContains") | |
1407 stringtochars_test('%s in vim.options') | |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1408 cb.append("> Dictionary") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1409 cb.append(">> DictionaryConstructor") |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1410 ee('vim.Dictionary("abcI")') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1411 ##! Not checked: py_dict_alloc failure |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1412 cb.append(">> DictionarySetattr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1413 ee('del d.locked') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1414 ee('d.locked = FailingTrue()') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1415 ee('vim.vvars.locked = False') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1416 ee('d.scope = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1417 ee('d.xxx = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1418 cb.append(">> _DictionaryItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1419 ee('d.get("a", 2, 3)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1420 stringtochars_test('d.get(%s)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1421 ee('d.pop("a")') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1422 ee('dl.pop("a")') |
5426 | 1423 cb.append(">> DictionaryContains") |
1424 ee('"" in d') | |
1425 ee('0 in d') | |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1426 cb.append(">> DictionaryIterNext") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1427 ee('for i in ned: ned["a"] = 1') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1428 del i |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1429 cb.append(">> DictionaryAssItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1430 ee('dl["b"] = 1') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1431 stringtochars_test('d[%s] = 1') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1432 convertfrompyobject_test('d["a"] = %s') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1433 cb.append(">> DictionaryUpdate") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1434 cb.append(">>> kwargs") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1435 cb.append(">>> iter") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1436 ee('d.update(FailingMapping())') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1437 ee('d.update([FailingIterNext()])') |
5608 | 1438 ee('d.update([FailingIterNextN(1)])') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1439 iter_test('d.update(%s)') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1440 convertfrompyobject_test('d.update(%s)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1441 stringtochars_test('d.update(((%s, 0),))') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1442 convertfrompyobject_test('d.update((("a", %s),))') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1443 cb.append(">> DictionaryPopItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1444 ee('d.popitem(1, 2)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1445 cb.append(">> DictionaryHasKey") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1446 ee('d.has_key()') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1447 cb.append("> List") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1448 cb.append(">> ListConstructor") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1449 ee('vim.List(1, 2)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1450 ee('vim.List(a=1)') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1451 iter_test('vim.List(%s)') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1452 convertfrompyobject_test('vim.List([%s])') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1453 cb.append(">> ListItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1454 ee('l[1000]') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1455 cb.append(">> ListAssItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1456 ee('ll[1] = 2') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1457 ee('l[1000] = 3') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1458 cb.append(">> ListAssSlice") |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1459 ee('ll[1:100] = "abcJ"') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1460 iter_test('l[:] = %s') |
5608 | 1461 ee('nel[1:10:2] = "abcK"') |
1462 cb.append(repr(tuple(nel))) | |
1463 ee('nel[1:10:2] = "a"') | |
1464 cb.append(repr(tuple(nel))) | |
1465 ee('nel[1:1:-1] = "a"') | |
1466 cb.append(repr(tuple(nel))) | |
1467 ee('nel[:] = FailingIterNextN(2)') | |
1468 cb.append(repr(tuple(nel))) | |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1469 convertfrompyobject_test('l[:] = [%s]') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1470 cb.append(">> ListConcatInPlace") |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1471 iter_test('l.extend(%s)') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1472 convertfrompyobject_test('l.extend([%s])') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1473 cb.append(">> ListSetattr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1474 ee('del l.locked') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1475 ee('l.locked = FailingTrue()') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1476 ee('l.xxx = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1477 cb.append("> Function") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1478 cb.append(">> FunctionConstructor") |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1479 cb.append(">>> FunctionConstructor") |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1480 ee('vim.Function("123")') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1481 ee('vim.Function("xxx_non_existent_function_xxx")') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1482 ee('vim.Function("xxx#non#existent#function#xxx")') |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1483 ee('vim.Function("xxx_non_existent_function_xxx2", args=[])') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1484 ee('vim.Function("xxx_non_existent_function_xxx3", self={})') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1485 ee('vim.Function("xxx_non_existent_function_xxx4", args=[], self={})') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1486 cb.append(">>> FunctionNew") |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1487 ee('vim.Function("tr", self="abcFuncSelf")') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1488 ee('vim.Function("tr", args=427423)') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1489 ee('vim.Function("tr", self="abcFuncSelf2", args="abcFuncArgs2")') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1490 ee('vim.Function(self="abcFuncSelf2", args="abcFuncArgs2")') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1491 ee('vim.Function("tr", "", self="abcFuncSelf2", args="abcFuncArgs2")') |
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1492 ee('vim.Function("tr", "")') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1493 cb.append(">> FunctionCall") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1494 convertfrompyobject_test('f(%s)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1495 convertfrompymapping_test('fd(self=%s)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1496 cb.append("> TabPage") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1497 cb.append(">> TabPageAttr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1498 ee('vim.current.tabpage.xxx') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1499 cb.append("> TabList") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1500 cb.append(">> TabListItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1501 ee('vim.tabpages[1000]') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1502 cb.append("> Window") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1503 cb.append(">> WindowAttr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1504 ee('vim.current.window.xxx') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1505 cb.append(">> WindowSetattr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1506 ee('vim.current.window.buffer = 0') |
4665
7a35419393c3
updated for version 7.3.1080
Bram Moolenaar <bram@vim.org>
parents:
4645
diff
changeset
|
1507 ee('vim.current.window.cursor = (100000000, 100000000)') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1508 ee('vim.current.window.cursor = True') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1509 number_test('vim.current.window.height = %s', unsigned=True) |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1510 number_test('vim.current.window.width = %s', unsigned=True) |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1511 ee('vim.current.window.xxxxxx = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1512 cb.append("> WinList") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1513 cb.append(">> WinListItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1514 ee('vim.windows[1000]') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1515 cb.append("> Buffer") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1516 cb.append(">> StringToLine (indirect)") |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1517 ee('vim.current.buffer[0] = u"\\na"') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1518 ee('vim.current.buffer[0] = "\\na"') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1519 cb.append(">> SetBufferLine (indirect)") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1520 ee('vim.current.buffer[0] = True') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1521 cb.append(">> SetBufferLineList (indirect)") |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1522 ee('vim.current.buffer[:] = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1523 ee('vim.current.buffer[:] = ["\\na", "bc"]') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1524 cb.append(">> InsertBufferLines (indirect)") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1525 ee('vim.current.buffer.append(None)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1526 ee('vim.current.buffer.append(["\\na", "bc"])') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1527 ee('vim.current.buffer.append("\\nbc")') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1528 cb.append(">> RBItem") |
4665
7a35419393c3
updated for version 7.3.1080
Bram Moolenaar <bram@vim.org>
parents:
4645
diff
changeset
|
1529 ee('vim.current.buffer[100000000]') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1530 cb.append(">> RBAsItem") |
4665
7a35419393c3
updated for version 7.3.1080
Bram Moolenaar <bram@vim.org>
parents:
4645
diff
changeset
|
1531 ee('vim.current.buffer[100000000] = ""') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1532 cb.append(">> BufferAttr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1533 ee('vim.current.buffer.xxx') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1534 cb.append(">> BufferSetattr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1535 ee('vim.current.buffer.name = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1536 ee('vim.current.buffer.xxx = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1537 cb.append(">> BufferMark") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1538 ee('vim.current.buffer.mark(0)') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1539 ee('vim.current.buffer.mark("abcM")') |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1540 ee('vim.current.buffer.mark("!")') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1541 cb.append(">> BufferRange") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1542 ee('vim.current.buffer.range(1, 2, 3)') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1543 cb.append("> BufMap") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1544 cb.append(">> BufMapItem") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1545 ee('vim.buffers[100000000]') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1546 number_test('vim.buffers[%s]', natural=True) |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1547 cb.append("> Current") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1548 cb.append(">> CurrentGetattr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1549 ee('vim.current.xxx') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1550 cb.append(">> CurrentSetattr") |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1551 ee('vim.current.line = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1552 ee('vim.current.buffer = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1553 ee('vim.current.window = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1554 ee('vim.current.tabpage = True') |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1555 ee('vim.current.xxx = True') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1556 del d |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1557 del ned |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1558 del dl |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1559 del l |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1560 del ll |
5608 | 1561 del nel |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1562 del f |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1563 del fd |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1564 del fdel |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1565 del subexpr_test |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1566 del stringtochars_test |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1567 del Mapping |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1568 del convertfrompyobject_test |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1569 del convertfrompymapping_test |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1570 del iter_test |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1571 del number_test |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1572 del FailingTrue |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1573 del FailingIter |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1574 del FailingIterNext |
5608 | 1575 del FailingIterNextN |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1576 del FailingMapping |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1577 del FailingMappingKey |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1578 del FailingList |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1579 del NoArgsCall |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1580 del FailingCall |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1581 del FailingNumber |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1582 EOF |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1583 :delfunction F |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1584 :" |
4839
d59ff2114733
updated for version 7.3.1166
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1585 :" Test import |
d59ff2114733
updated for version 7.3.1166
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1586 py << EOF |
4851
96e154e825a7
updated for version 7.3.1172
Bram Moolenaar <bram@vim.org>
parents:
4839
diff
changeset
|
1587 sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) |
96e154e825a7
updated for version 7.3.1172
Bram Moolenaar <bram@vim.org>
parents:
4839
diff
changeset
|
1588 sys.path.append(os.path.join(os.getcwd(), 'python_after')) |
4839
d59ff2114733
updated for version 7.3.1166
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1589 vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1590 l = [] |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1591 def callback(path): |
5012
6aecf486bb34
updated for version 7.3.1250
Bram Moolenaar <bram@vim.org>
parents:
4982
diff
changeset
|
1592 l.append(path[-len('/testdir'):].replace(os.path.sep, '/')) |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1593 vim.foreach_rtp(callback) |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1594 cb.append(repr(l)) |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1595 del l |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1596 def callback(path): |
5012
6aecf486bb34
updated for version 7.3.1250
Bram Moolenaar <bram@vim.org>
parents:
4982
diff
changeset
|
1597 return path[-len('/testdir'):].replace(os.path.sep, '/') |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1598 cb.append(repr(vim.foreach_rtp(callback))) |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1599 del callback |
4839
d59ff2114733
updated for version 7.3.1166
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1600 from module import dir as d |
d59ff2114733
updated for version 7.3.1166
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1601 from modulex import ddir |
d59ff2114733
updated for version 7.3.1166
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1602 cb.append(d + ',' + ddir) |
4851
96e154e825a7
updated for version 7.3.1172
Bram Moolenaar <bram@vim.org>
parents:
4839
diff
changeset
|
1603 import before |
96e154e825a7
updated for version 7.3.1172
Bram Moolenaar <bram@vim.org>
parents:
4839
diff
changeset
|
1604 cb.append(before.dir) |
96e154e825a7
updated for version 7.3.1172
Bram Moolenaar <bram@vim.org>
parents:
4839
diff
changeset
|
1605 import after |
96e154e825a7
updated for version 7.3.1172
Bram Moolenaar <bram@vim.org>
parents:
4839
diff
changeset
|
1606 cb.append(after.dir) |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1607 import topmodule as tm |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1608 import topmodule.submodule as tms |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1609 import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss |
5012
6aecf486bb34
updated for version 7.3.1250
Bram Moolenaar <bram@vim.org>
parents:
4982
diff
changeset
|
1610 cb.append(tm.__file__.replace('.pyc', '.py').replace(os.path.sep, '/')[-len('modulex/topmodule/__init__.py'):]) |
6aecf486bb34
updated for version 7.3.1250
Bram Moolenaar <bram@vim.org>
parents:
4982
diff
changeset
|
1611 cb.append(tms.__file__.replace('.pyc', '.py').replace(os.path.sep, '/')[-len('modulex/topmodule/submodule/__init__.py'):]) |
6aecf486bb34
updated for version 7.3.1250
Bram Moolenaar <bram@vim.org>
parents:
4982
diff
changeset
|
1612 cb.append(tmsss.__file__.replace('.pyc', '.py').replace(os.path.sep, '/')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1613 del before |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1614 del after |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1615 del d |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1616 del ddir |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1617 del tm |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1618 del tms |
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1619 del tmsss |
4839
d59ff2114733
updated for version 7.3.1166
Bram Moolenaar <bram@vim.org>
parents:
4833
diff
changeset
|
1620 EOF |
4833
70b1178dec79
updated for version 7.3.1163
Bram Moolenaar <bram@vim.org>
parents:
4706
diff
changeset
|
1621 :" |
4637
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1622 :" Test exceptions |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1623 :fun Exe(e) |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1624 : execute a:e |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1625 :endfun |
4c46e1487c63
updated for version 7.3.1066
Bram Moolenaar <bram@vim.org>
parents:
4631
diff
changeset
|
1626 py << EOF |
4498 | 1627 Exe = vim.bindeval('function("Exe")') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1628 ee('vim.command("throw \'abcN\'")') |
4498 | 1629 ee('Exe("throw \'def\'")') |
1630 ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")') | |
1631 ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")') | |
1632 ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")') | |
5517 | 1633 ee('vim.eval("xxx_unknown_function_xxx()")') |
4498 | 1634 ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")') |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1635 del Exe |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1636 EOF |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1637 :delfunction Exe |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1638 :" |
5469 | 1639 :" Regression: interrupting vim.command propagates to next vim.command |
1640 py << EOF | |
1641 def test_keyboard_interrupt(): | |
1642 try: | |
1643 vim.command('while 1 | endwhile') | |
1644 except KeyboardInterrupt: | |
1645 cb.append('Caught KeyboardInterrupt') | |
1646 except Exception: | |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1647 cb.append('!!!!!!!! Caught exception: ' + emsg(sys.exc_info())) |
5469 | 1648 else: |
1649 cb.append('!!!!!!!! No exception') | |
1650 try: | |
1651 vim.command('$ put =\'Running :put\'') | |
1652 except KeyboardInterrupt: | |
1653 cb.append('!!!!!!!! Caught KeyboardInterrupt') | |
1654 except Exception: | |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1655 cb.append('!!!!!!!! Caught exception: ' + emsg(sys.exc_info())) |
5469 | 1656 else: |
1657 cb.append('No exception') | |
1658 EOF | |
1659 :debuggreedy | |
1660 :call inputsave() | |
1661 :call feedkeys("s\ns\ns\ns\nq\n") | |
1662 :redir => output | |
1663 :debug silent! py test_keyboard_interrupt() | |
1664 :redir END | |
1665 :0 debuggreedy | |
6257 | 1666 :call inputrestore() |
5469 | 1667 :silent $put =output |
1668 :unlet output | |
1669 :py del test_keyboard_interrupt | |
1670 :" | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1671 :" Cleanup |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1672 py << EOF |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1673 del cb |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1674 del ee |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1675 del emsg |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1676 del sys |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1677 del os |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1678 del vim |
4498 | 1679 EOF |
3618 | 1680 :endfun |
1681 :" | |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1682 :fun RunTest() |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1683 :let checkrefs = !empty($PYTHONDUMPREFS) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1684 :let start = getline(1, '$') |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1685 :for i in range(checkrefs ? 10 : 1) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1686 : if i != 0 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1687 : %d _ |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1688 : call setline(1, start) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1689 : endif |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1690 : call Test() |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1691 : if i == 0 |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1692 : let result = getline(1, '$') |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1693 : endif |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1694 :endfor |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1695 :if checkrefs |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1696 : %d _ |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1697 : call setline(1, result) |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1698 :endif |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1699 :endfun |
3618 | 1700 :" |
4976
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1701 :call RunTest() |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1702 :delfunction RunTest |
4ed713442c51
updated for version 7.3.1233
Bram Moolenaar <bram@vim.org>
parents:
4853
diff
changeset
|
1703 :delfunction Test |
3618 | 1704 :call garbagecollect(1) |
1705 :" | |
1706 :/^start:/,$wq! test.out | |
4982
39980afcf54a
updated for version 7.3.1236
Bram Moolenaar <bram@vim.org>
parents:
4976
diff
changeset
|
1707 :" vim: et ts=4 isk-=\: |
8889
8755d57debaa
commit https://github.com/vim/vim/commit/8110a091bc749d8748a20807a724a3af3ca6d509
Christian Brabandt <cb@256bit.org>
parents:
7660
diff
changeset
|
1708 :while getchar(0) isnot 0|endwhile |
3618 | 1709 ENDTEST |
1710 | |
1711 start: |