mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
Test for an issue with for loops and a statement on the same line. (fast parser)
This commit is contained in:
@@ -13,15 +13,15 @@ def test_add_to_end():
|
|||||||
help of caches, this is an example that didn't work.
|
help of caches, this is an example that didn't work.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
a = """
|
a = dedent("""
|
||||||
class Abc():
|
class Abc():
|
||||||
def abc(self):
|
def abc(self):
|
||||||
self.x = 3
|
self.x = 3
|
||||||
|
|
||||||
class Two(Abc):
|
class Two(Abc):
|
||||||
def h(self):
|
def h(self):
|
||||||
self
|
self
|
||||||
""" # ^ here is the first completion
|
""") # ^ here is the first completion
|
||||||
|
|
||||||
b = " def g(self):\n" \
|
b = " def g(self):\n" \
|
||||||
" self."
|
" self."
|
||||||
@@ -259,6 +259,17 @@ def test_class_func_if():
|
|||||||
check_fp(src, 3)
|
check_fp(src, 3)
|
||||||
|
|
||||||
|
|
||||||
|
def test_for_on_one_line():
|
||||||
|
src = dedent("""\
|
||||||
|
foo = 1
|
||||||
|
for x in foo: pass
|
||||||
|
|
||||||
|
def hi():
|
||||||
|
pass
|
||||||
|
""")
|
||||||
|
check_fp(src, 2)
|
||||||
|
|
||||||
|
|
||||||
def test_wrong_indentation():
|
def test_wrong_indentation():
|
||||||
src = dedent("""\
|
src = dedent("""\
|
||||||
def func():
|
def func():
|
||||||
|
|||||||
Reference in New Issue
Block a user