#NEWLINE# def testIndentBlock( self ) : #NEWLINE# #INDENT# result = lua . Lua . from_lines ( [ '\na = 1\ndo\nb = 2\n    c = 3\nend\n d = 4\n\nwhile foo do\n e = 5\n  end\nrepeat\n  f = 6\n g = 7\n    h = 8\nuntil foo\n\nif foo then\n i = 9\n  elseif bar then\n   j = 10\n    else\n     k = 11\n      end\n\nfor x=1,10,2 do\n      l = 12\n       m = 13\nend\nfor x in foo do\n        n = 14\n         o = 15\nend\n' ] , 4 ) #NEWLINE# lines = list ( result . to_lines ( writer_cls = lua . LuaFormatterWriter ) ) #NEWLINE# txt = '' . join ( lines ) #NEWLINE# self . assertEqual ( '\na = 1\ndo\n  b = 2\n  c = 3\nend\nd = 4\n\nwhile foo do\n  e = 5\nend\nrepeat\n  f = 6\n  g = 7\n  h = 8\nuntil foo\n\nif foo then\n  i = 9\nelseif bar then\n  j = 10\nelse\n  k = 11\nend\n\nfor x=1,10,2 do\n  l = 12\n  m = 13\nend\nfor x in foo do\n  n = 14\n  o = 15\nend\n' , txt )