1
0
forked from VimPlug/jedi

added ordering tests

This commit is contained in:
David Halter
2012-05-02 17:10:31 +02:00
parent 29f05aad8f
commit 1340ccb33d
5 changed files with 119 additions and 12 deletions

View File

@@ -39,8 +39,31 @@ def variable_rename(param):
#? ['imag']
variable_rename(1).imag
# double execution -> shouldn't work (and throw no error)
# -----------------
# double execution
# -----------------
def double_exe(param):
return param
#? ['upper']
variable_rename(double_exe)("").upper
# -> shouldn't work (and throw no error)
#? []
variable_rename(list())().
#? []
variable_rename(1)().
# -----------------
# closures
# -----------------
def a():
l = 3
def func_b():
#? ['real']
l.real
l = ''
#? ['func_b']
func_b
#? ['real']
l.real

View File

@@ -1,4 +1,6 @@
# -----------------
# normal
# -----------------
a = ""
a = 1
@@ -9,10 +11,41 @@ a.upper
#? []
a.append
a = list
b ="";b=1
#? ['real']
b.real
#? []
b.upper
# -----------------
# tuples exchanges
# -----------------
a, b = 1, ""
#? ['real']
a.real
#? []
a.upper
#? []
b.real
#? ['upper']
b.upper
b, a = a, b
#? ['real']
b.real
#? []
b.upper
#? []
a.real
#? ['upper']
a.upper
# -----------------
# function stuff
# -----------------
def a(a=3):
#? ['real']
a.real
@@ -28,8 +61,9 @@ a(2).real
a(2).upper
#? []
a(2).func
# -----------------
# class stuff
# -----------------
class A(object):
a = ""
a = 3
@@ -59,13 +93,61 @@ class A(object):
#? ['upper']
self.a.upper
#? ['after']
self.after
def after(self):
self.a = ''
##? ['real']
#? []
A.a.real
##? []
#? []
A.a.upper
##? []
#? ['append']
A.a.append
a = A()
#? ['after']
a.after
#? []
a.upper
#? []
a.append
#? []
a.real
#? ['append']
a.a.append
#? ['real']
a.a.real
#? ['upper']
a.a.upper
# -----------------
# class stuff
# -----------------
math = 3
import math
#? ['cosh']
math.cosh
#? []
math.real
math = 3
#? ['real']
math.real
#? []
math.cos
# do the same for star imports
cosh = 3
from math import *
# This doesn't work, but that's not a problem, star imports should be at the
# start of EVERY script!
##? []
cosh.real
cosh = 3
#? ['real']
cosh.real

View File

@@ -72,7 +72,7 @@ tup.c
tup2 = tuple()
#? ['index']
tup2.i
##? ['index'] TODO enable
#? ['index']
().i
tup3 = 1,""