diff --git a/test/test_parser/test_fast_parser.py b/test/test_parser/test_fast_parser.py index 01d4dfd3..cfa9772a 100644 --- a/test/test_parser/test_fast_parser.py +++ b/test/test_parser/test_fast_parser.py @@ -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():