mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
updated for version 7.3.659
Problem: Recent Python changes are not tested. Solution: Add tests for Python bindings. (ZyX)
This commit is contained in:
parent
afa6b9af86
commit
c11073c9aa
@ -176,28 +176,62 @@ STARTTEST
|
||||
:else
|
||||
: $put ='[0.0, 0.0]'
|
||||
:endif
|
||||
:let messages=[]
|
||||
:py <<EOF
|
||||
d=vim.bindeval('{}')
|
||||
m=vim.bindeval('messages')
|
||||
try:
|
||||
d['abc']
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['abc']="\0"
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['abc']=vim
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['']=1
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['a\0b']=1
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d[b'a\0b']=1
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
EOF
|
||||
:$put =messages
|
||||
:"
|
||||
:" pyeval()
|
||||
:let l=pyeval('range(3)')
|
||||
:$put =string(l)
|
||||
:let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}')
|
||||
:$put =sort(items(d))
|
||||
:try
|
||||
: let undef=pyeval('undefined_name')
|
||||
:catch
|
||||
: $put =v:exception[:13]
|
||||
:endtry
|
||||
:try
|
||||
: let vim=pyeval('vim')
|
||||
:catch
|
||||
: $put =v:exception[:13]
|
||||
:endtry
|
||||
:if has('float')
|
||||
: let f=pyeval('0.0')
|
||||
: $put =string(f)
|
||||
:else
|
||||
: $put ='0.0'
|
||||
:endif
|
||||
:" Invalid values:
|
||||
:for e in ['"\0"', '{"\0": 1}', 'undefined_name', 'vim']
|
||||
: try
|
||||
: let v=pyeval(e)
|
||||
: catch
|
||||
: let toput=e.":\t".v:exception[:13]
|
||||
: $put =toput
|
||||
: endtry
|
||||
:endfor
|
||||
:endfun
|
||||
:"
|
||||
:call Test()
|
||||
|
@ -38,10 +38,18 @@ Vim(put):E684:
|
||||
Vim(python):E725:
|
||||
Vim(python):E117:
|
||||
[0.0, 0.0]
|
||||
IndexError
|
||||
TypeError
|
||||
TypeError
|
||||
ValueError
|
||||
TypeError
|
||||
TypeError
|
||||
[0, 1, 2]
|
||||
['a', 'b']
|
||||
['c', 1]
|
||||
['d', ['e']]
|
||||
Vim(let):E858:
|
||||
Vim(let):E859:
|
||||
0.0
|
||||
"\0": Vim(let):E859:
|
||||
{"\0": 1}: Vim(let):E859:
|
||||
undefined_name: Vim(let):E858:
|
||||
vim: Vim(let):E859:
|
||||
|
@ -176,28 +176,62 @@ STARTTEST
|
||||
:else
|
||||
: $put ='[0.0, 0.0]'
|
||||
:endif
|
||||
:let messages=[]
|
||||
:py3 <<EOF
|
||||
d=vim.bindeval('{}')
|
||||
m=vim.bindeval('messages')
|
||||
try:
|
||||
d['abc']
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['abc']="\0"
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['abc']=vim
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['']=1
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d['a\0b']=1
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
|
||||
try:
|
||||
d[b'a\0b']=1
|
||||
except Exception as e:
|
||||
m.extend([e.__class__.__name__])
|
||||
EOF
|
||||
:$put =messages
|
||||
:"
|
||||
:" py3eval()
|
||||
:let l=py3eval('[0, 1, 2]')
|
||||
:$put =string(l)
|
||||
:let d=py3eval('{"a": "b", "c": 1, "d": ["e"]}')
|
||||
:$put =sort(items(d))
|
||||
:try
|
||||
: let undef=py3eval('undefined_name')
|
||||
:catch
|
||||
: $put =v:exception[:13]
|
||||
:endtry
|
||||
:try
|
||||
: let vim=py3eval('vim')
|
||||
:catch
|
||||
: $put =v:exception[:13]
|
||||
:endtry
|
||||
:if has('float')
|
||||
: let f=py3eval('0.0')
|
||||
: $put =string(f)
|
||||
:else
|
||||
: $put ='0.0'
|
||||
:endif
|
||||
:" Invalid values:
|
||||
:for e in ['"\0"', '{"\0": 1}', 'undefined_name', 'vim']
|
||||
: try
|
||||
: let v=py3eval(e)
|
||||
: catch
|
||||
: let toput=e.":\t".v:exception[:13]
|
||||
: $put =toput
|
||||
: endtry
|
||||
:endfor
|
||||
:endfun
|
||||
:"
|
||||
:call Test()
|
||||
|
@ -38,10 +38,18 @@ Vim(put):E684:
|
||||
Vim(py3):E725:
|
||||
Vim(py3):E117:
|
||||
[0.0, 0.0]
|
||||
IndexError
|
||||
TypeError
|
||||
TypeError
|
||||
ValueError
|
||||
TypeError
|
||||
TypeError
|
||||
[0, 1, 2]
|
||||
['a', 'b']
|
||||
['c', 1]
|
||||
['d', ['e']]
|
||||
Vim(let):E860:
|
||||
Vim(let):E861:
|
||||
0.0
|
||||
"\0": Vim(let):E861:
|
||||
{"\0": 1}: Vim(let):E861:
|
||||
undefined_name: Vim(let):E860:
|
||||
vim: Vim(let):E861:
|
||||
|
@ -719,6 +719,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
659,
|
||||
/**/
|
||||
658,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user