示例#1
0
 def test_invoke_multiple_functions_in_dummy_method_class(self) -> None:
     fn_obj0 = _HackFunctionGenerator("F0")
     fn_obj1 = _HackFunctionGenerator("F1")
     self.obj.add_invoke_function(fn_obj1)
     self.obj.add_invoke_function(fn_obj0)
     self.assertEqual(
         "class C0   {\npublic function dummy_C0_method(): void{\nF0();\n\nF1();\n}\n}",
         str(self.obj),
     )
示例#2
0
 def test_invoke_function(self) -> None:
     fn_obj = _HackFunctionGenerator("F1")
     self.obj.add_invoke_function(fn_obj)
     self.assertEqual(
         "function F0(): void {\nF1();\n}",
         str(self.obj),
     )
示例#3
0
 def test_invoke_single_function_in_dummy_method_class(self) -> None:
     fn_obj = _HackFunctionGenerator("F0")
     self.obj.add_invoke_function(fn_obj)
     self.assertEqual(
         "class C0   {\npublic function dummy_C0_method(): void{\nF0();\n}\n}",
         str(self.obj),
     )
示例#4
0
 def setUp(self) -> None:
     self.obj = _HackFunctionGenerator("F0")