void () { // Class. doTest( "class Foo:\n" + " print <caret>123", "class Foo:\n" + " print <caret>123" ); // Function. doTest( "def test(value):\n" + " print <caret>value", "def test(value):\n" + " print <caret>value" ); // If. doTest( """ def test(value): if value == 123: print <caret>value""", """ def test(value): if value == 123: print <caret>value""" ); doTest( """ def test(value): if value == 123: pass elif value == 124: print <caret>value""", """ def test(value): if value == 123: pass elif value == 124: print <caret>value""" ); doTest( """ def test(value): if value == 123: pass else: print <caret>value""", """ def test(value): if value == 123: pass else: print <caret>value""" ); // While. doTest( """ def test(value): while value == 123: print <caret>value""", """ def test(value): while value == 123: print <caret>value""" ); doTest( """ def test(value): while value == 123: pass else: print <caret>value""", """ def test(value): while value == 123: pass else: print <caret>value""" ); // For. doTest( """ def test(value): for i in value: print <caret>value""", """ def test(value): for i in value: print <caret>value""" ); doTest( """ def test(value): for i in value: pass else print <caret>value""", """ def test(value): for i in value: pass else print <caret>value""" ); // Try. doTest( """ def test(value): try: open()<caret> except: pass""", """ def test(value): try: open()<caret> except: pass""" ); doTest( """ def test(value): try: open() except: print <caret>123""", """ def test(value): try: open() except: print <caret>123""" ); doTest( """ def test(value): try: open() finally: print <caret>123""", """ def test(value): try: open() finally: print <caret>123""" ); //With. runWithLanguageLevel( LanguageLevel.PYTHON26, () -> doTest( """ def test(value): with 1 + 1 as a: print <caret>a""", """ def test(value): with 1 + 1 as a: print <caret>a""" ) ); }