forked from VimPlug/jedi
Fixed whitespace problems in completion tests
This commit is contained in:
@@ -224,7 +224,7 @@ f()
|
|||||||
d = dict({'a':''})
|
d = dict({'a':''})
|
||||||
def y(a):
|
def y(a):
|
||||||
return a
|
return a
|
||||||
#?
|
#?
|
||||||
y(**d)
|
y(**d)
|
||||||
|
|
||||||
# problem with more complicated casts
|
# problem with more complicated casts
|
||||||
@@ -297,7 +297,7 @@ list(a)[1]
|
|||||||
|
|
||||||
#? int() str()
|
#? int() str()
|
||||||
list(a)[0]
|
list(a)[0]
|
||||||
#?
|
#?
|
||||||
set(a)[0]
|
set(a)[0]
|
||||||
|
|
||||||
#? int() str()
|
#? int() str()
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ gen = (i for i in (1,))
|
|||||||
|
|
||||||
#? int()
|
#? int()
|
||||||
next(gen)
|
next(gen)
|
||||||
#?
|
#?
|
||||||
gen[0]
|
gen[0]
|
||||||
|
|
||||||
gen = (a for arr in [[1.0]] for a in arr)
|
gen = (a for arr in [[1.0]] for a in arr)
|
||||||
@@ -275,7 +275,7 @@ def a():
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
#?
|
#?
|
||||||
# str literals in comment """ upper
|
# str literals in comment """ upper
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
@@ -278,10 +278,10 @@ def Recursion():
|
|||||||
self.a = self.a
|
self.a = self.a
|
||||||
self.b = self.b.recurse()
|
self.b = self.b.recurse()
|
||||||
|
|
||||||
#?
|
#?
|
||||||
Recursion().a
|
Recursion().a
|
||||||
|
|
||||||
#?
|
#?
|
||||||
Recursion().b
|
Recursion().b
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -323,15 +323,15 @@ getattr(str(), 'upper')
|
|||||||
getattr(str, 'upper')
|
getattr(str, 'upper')
|
||||||
|
|
||||||
# some strange getattr calls
|
# some strange getattr calls
|
||||||
#?
|
#?
|
||||||
getattr(str, 1)
|
getattr(str, 1)
|
||||||
#?
|
#?
|
||||||
getattr()
|
getattr()
|
||||||
#?
|
#?
|
||||||
getattr(str)
|
getattr(str)
|
||||||
#?
|
#?
|
||||||
getattr(getattr, 1)
|
getattr(getattr, 1)
|
||||||
#?
|
#?
|
||||||
getattr(str, [])
|
getattr(str, [])
|
||||||
|
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ class PrivateVar():
|
|||||||
self.__var
|
self.__var
|
||||||
#? []
|
#? []
|
||||||
PrivateVar().__var
|
PrivateVar().__var
|
||||||
#?
|
#?
|
||||||
PrivateVar().__var
|
PrivateVar().__var
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -384,7 +384,7 @@ class Super(object):
|
|||||||
a = 3
|
a = 3
|
||||||
|
|
||||||
class TestSuper(Super):
|
class TestSuper(Super):
|
||||||
#?
|
#?
|
||||||
super()
|
super()
|
||||||
def test(self):
|
def test(self):
|
||||||
#? Super()
|
#? Super()
|
||||||
@@ -395,7 +395,7 @@ class TestSuper(Super):
|
|||||||
#? Super()
|
#? Super()
|
||||||
super()
|
super()
|
||||||
def a():
|
def a():
|
||||||
#?
|
#?
|
||||||
super()
|
super()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ exe[0]
|
|||||||
exe[1]
|
exe[1]
|
||||||
|
|
||||||
# illegal args (TypeError)
|
# illegal args (TypeError)
|
||||||
#?
|
#?
|
||||||
args_func(*1)[0]
|
args_func(*1)[0]
|
||||||
# iterator
|
# iterator
|
||||||
#? int()
|
#? int()
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ def collect_file_tests(lines, lines_to_execute):
|
|||||||
correct = None
|
correct = None
|
||||||
test_type = None
|
test_type = None
|
||||||
for line_nr, line in enumerate(lines, 1):
|
for line_nr, line in enumerate(lines, 1):
|
||||||
if correct:
|
if correct is not None:
|
||||||
r = re.match('^(\d+)\s*(.*)$', correct)
|
r = re.match('^(\d+)\s*(.*)$', correct)
|
||||||
if r:
|
if r:
|
||||||
column = int(r.group(1))
|
column = int(r.group(1))
|
||||||
@@ -255,10 +255,13 @@ def collect_file_tests(lines, lines_to_execute):
|
|||||||
correct = None
|
correct = None
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
r = re.search(r'(?:^|(?<=\s))#([?!<])\s*([^\n]+)', line)
|
r = re.search(r'(?:^|(?<=\s))#([?!<])\s*([^\n]*)', line)
|
||||||
# test_type is ? for completion and ! for goto_assignments
|
# test_type is ? for completion and ! for goto_assignments
|
||||||
test_type = r.group(1)
|
test_type = r.group(1)
|
||||||
correct = r.group(2)
|
correct = r.group(2)
|
||||||
|
# Quick hack to make everything work (not quite a bloody unicorn hack though).
|
||||||
|
if correct == '':
|
||||||
|
correct = ' '
|
||||||
start = r.start()
|
start = r.start()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
correct = None
|
correct = None
|
||||||
|
|||||||
Reference in New Issue
Block a user