예제 #1
0
    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_")
예제 #2
0
    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")
예제 #3
0
    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")