def test_lvn_ast2arg_expr_given_a_plus_c(self): as_tree = ast.parse(ms("""\ b = a + c""")) expr_str = Lvn.lvn_ast2arg_expr(as_tree.body[0]) self.assertEqual(expr_str, "#Add_")
def test_lvn_ast2arg_expr_given_3_add_a_expect_reorder(self): as_tree = ast.parse(ms("""\ b = 3 + a""")) expr_str = Lvn.lvn_ast2arg_expr(as_tree.body[0]) self.assertEqual(expr_str, "#Add3")
def test_lvn_ast2arg_expr_given_3_plus_3(self): as_tree = ast.parse(ms("""\ b = 3 + 3""")) expr_str = Lvn.lvn_ast2arg_expr(as_tree.body[0]) self.assertEqual(expr_str, "3Add3")