Skip to content

Commit

Permalink
Clean up tests for new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhartmann committed Nov 14, 2023
1 parent fd1076f commit 2e2fdf2
Showing 1 changed file with 0 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -849,41 +849,6 @@ def test_separated_by_loop_node_4(self, ast_while_in_else):

assert _initialization_reaches_loop_node(init_code_node, inner_while) is False

def test_for_loop_variable_generation(self):
renamer = ForLoopVariableRenamer(
AbstractSyntaxTree(SeqNode(LogicCondition.initialize_true(LogicCondition.generate_new_context())), {}),
["i", "j", "k", "l", "m", "n"]
)
assert [renamer._get_variable_name() for _ in range(14)] == [
"i",
"j",
"k",
"l",
"m",
"n",
"i1",
"j1",
"k1",
"l1",
"m1",
"n1",
"i2",
"j2",
]

def test_while_loop_variable_generation(self):
renamer = WhileLoopVariableRenamer(
AbstractSyntaxTree(SeqNode(LogicCondition.initialize_true(LogicCondition.generate_new_context())), {})
)
assert [renamer._get_variable_name() for _ in range(5)] == ["counter", "counter1", "counter2", "counter3", "counter4"]

def test_declaration_listop(self, ast_call_for_loop):
"""Test renaming with ListOperation as Declaration"""
ForLoopVariableRenamer(ast_call_for_loop, ["i"]).rename()
for node in ast_call_for_loop:
if isinstance(node, ForLoopNode):
assert node.declaration.destination.operands[0].name == "i"

def test_for_loop_recovery_if_continue_in_while_1(self):
"""
Test for loop recovery if a continue occurs in a while loop and the last definition is a simple binary operation
Expand Down

0 comments on commit 2e2fdf2

Please sign in to comment.