forked from VimPlug/jedi
add some operator tests for precedences (array indexing)
This commit is contained in:
25
test/completion/operators.py
Normal file
25
test/completion/operators.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
"""
|
||||||
|
Test Jedi's operation understanding. Jedi should understand simple additions,
|
||||||
|
multiplications, etc.
|
||||||
|
"""
|
||||||
|
x = [1, 'a', 1.0]
|
||||||
|
|
||||||
|
#? int() str() float()
|
||||||
|
x[12]
|
||||||
|
|
||||||
|
#? str()
|
||||||
|
x[1 + 1]
|
||||||
|
|
||||||
|
index = 0 + 2
|
||||||
|
|
||||||
|
#? float()
|
||||||
|
x[index]
|
||||||
|
|
||||||
|
|
||||||
|
def calculate(number):
|
||||||
|
return number + constant
|
||||||
|
|
||||||
|
constant = 1
|
||||||
|
|
||||||
|
#? float()
|
||||||
|
x[calculate(2)]
|
||||||
Reference in New Issue
Block a user