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. 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():