pull/1880/head
webthethird 2 years ago
parent 80c96cff84
commit 9c8eb75d43
  1. 4
      tests/unit/slithir/test_implicit_returns.py

@ -28,7 +28,7 @@ def test_named_return_with_explicit_return(slither_from_source) -> None:
node_if: Node = f.nodes[1] node_if: Node = f.nodes[1]
node_true = node_if.son_true node_true = node_if.son_true
node_false = node_if.son_false node_false = node_if.son_false
assert node_true == NodeType.RETURN assert node_true.type == NodeType.RETURN
assert isinstance(node_true.irs[0], Return) assert isinstance(node_true.irs[0], Return)
assert node_true.irs[0].values[0] == f.get_local_variable_from_name("x") assert node_true.irs[0].values[0] == f.get_local_variable_from_name("x")
assert len(node_true.sons) == 0 assert len(node_true.sons) == 0
@ -51,7 +51,7 @@ def test_issue_1846_ternary_in_ternary(slither_from_source):
with slither_from_source(source) as slither: with slither_from_source(source) as slither:
c: Contract = slither.get_contract_from_name("Contract")[0] c: Contract = slither.get_contract_from_name("Contract")[0]
f = c.functions[0] f = c.functions[0]
node_end_if = f.nodes[5] node_end_if = f.nodes[3]
assert node_end_if.type == NodeType.ENDIF assert node_end_if.type == NodeType.ENDIF
assert len(node_end_if.sons) == 1 assert len(node_end_if.sons) == 1
node_ret = node_end_if.sons[0] node_ret = node_end_if.sons[0]

Loading…
Cancel
Save