Test for an issue with for loops and a statement on the same line. (fast parser)

This commit is contained in:
Dave Halter
2015-02-14 16:27:04 +01:00
parent 4613a810a5
commit a3b32729a7

View File

@@ -13,15 +13,15 @@ def test_add_to_end():
help of caches, this is an example that didn't work.
"""
a = """
class Abc():
def abc(self):
self.x = 3
a = dedent("""
class Abc():
def abc(self):
self.x = 3
class Two(Abc):
def h(self):
self
""" # ^ here is the first completion
class Two(Abc):
def h(self):
self
""") # ^ here is the first completion
b = " def g(self):\n" \
" self."
@@ -259,6 +259,17 @@ def test_class_func_if():
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():
src = dedent("""\
def func():