|
|
|
@ -28,7 +28,7 @@ def test_named_return_with_explicit_return(slither_from_source) -> None: |
|
|
|
|
node_if: Node = f.nodes[1] |
|
|
|
|
node_true = node_if.son_true |
|
|
|
|
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 node_true.irs[0].values[0] == f.get_local_variable_from_name("x") |
|
|
|
|
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: |
|
|
|
|
c: Contract = slither.get_contract_from_name("Contract")[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 len(node_end_if.sons) == 1 |
|
|
|
|
node_ret = node_end_if.sons[0] |
|
|
|
|