def test_compile_subroutine_dec(self):
     engine = CompilationEngine("method void decSize(int Ax, int Ay) { var boolean exit; }", "fakeOutputFile", True)
     engine.compile_subroutine_dec()
     self.assertEqual(engine.xml_output, [
         '<subroutineDec>',
             '<keyword> method </keyword>',
             '<keyword> void </keyword>',
             '<identifier> decSize, category: subroutine, definedOrUsed: defined </identifier>',
             '<symbol> ( </symbol>',
             '<parameterList>',
                 '<keyword> int </keyword>',
                 '<identifier> Ax, category: argument, definedOrUsed: defined, index: 1 </identifier>',
                 '<symbol> , </symbol>',
                 '<keyword> int </keyword>',
                 '<identifier> Ay, category: argument, definedOrUsed: defined, index: 2 </identifier>',
             '</parameterList>',
             '<symbol> ) </symbol>',
             '<subroutineBody>',
                 '<symbol> { </symbol>',
                 '<varDec>',
                     '<keyword> var </keyword>',
                     '<keyword> boolean </keyword>',
                     '<identifier> exit, category: local, definedOrUsed: defined, index: 0 </identifier>',
                     '<symbol> ; </symbol>',
                 '</varDec>',
                 '<statements>',
                 '</statements>',
                 '<symbol> } </symbol>',
             '</subroutineBody>',
         '</subroutineDec>'])
 def test_compile_subroutine_dec(self):
     engine = CompilationEngine(
         "method void decSize(int Ax, int Ay) { var boolean exit; }",
         "fakeOutputFile", True)
     engine.compile_subroutine_dec()
     self.assertEqual(engine.output, [
         '<subroutineDec>', '<keyword> method </keyword>',
         '<keyword> void </keyword>', '<identifier> decSize </identifier>',
         '<symbol> ( </symbol>', '<parameterList>',
         '<keyword> int </keyword>', '<identifier> Ax </identifier>',
         '<symbol> , </symbol>', '<keyword> int </keyword>',
         '<identifier> Ay </identifier>', '</parameterList>',
         '<symbol> ) </symbol>', '<subroutineBody>', '<symbol> { </symbol>',
         '<varDec>', '<keyword> var </keyword>',
         '<keyword> boolean </keyword>', '<identifier> exit </identifier>',
         '<symbol> ; </symbol>', '</varDec>', '<statements>',
         '</statements>', '<symbol> } </symbol>', '</subroutineBody>',
         '</subroutineDec>'
     ])