Python: Add some regression tests for CFG of comparisons.

This commit is contained in:
Mark Shannon
2019-01-16 11:45:20 +00:00
parent d1d898efac
commit e506bf85e8
3 changed files with 30 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
| compare.py | 3 | compare.py:3:5:3:23 | ControlFlowNode for Assert | Entry node for Function contains1 |
| compare.py | 7 | compare.py:7:5:7:27 | ControlFlowNode for Assert | Entry node for Function contains2 |
| true_false_test.py | 14 | true_false_test.py:14:12:14:16 | ControlFlowNode for cond4 | ControlFlowNode for Pass |
| true_false_test.py | 15 | true_false_test.py:15:13:15:17 | ControlFlowNode for true4 | ControlFlowNode for Pass |
| true_false_test.py | 15 | true_false_test.py:15:13:15:19 | ControlFlowNode for true4() | ControlFlowNode for Pass |

View File

@@ -18,6 +18,14 @@
| boolops.py | 10 | boolops.py:10:20:10:21 | ControlFlowNode for y2 | ControlFlowNode for z2 | True |
| boolops.py | 11 | boolops.py:11:20:11:21 | ControlFlowNode for z2 | ControlFlowNode for UnaryExpr | False |
| boolops.py | 11 | boolops.py:11:20:11:21 | ControlFlowNode for z2 | ControlFlowNode for UnaryExpr | True |
| compare.py | 3 | compare.py:3:12:3:23 | ControlFlowNode for Compare | ControlFlowNode for Assert | False |
| compare.py | 3 | compare.py:3:12:3:23 | ControlFlowNode for Compare | ControlFlowNode for Assert | True |
| compare.py | 7 | compare.py:7:12:7:27 | ControlFlowNode for Compare | ControlFlowNode for Assert | False |
| compare.py | 7 | compare.py:7:12:7:27 | ControlFlowNode for Compare | ControlFlowNode for Assert | True |
| compare.py | 11 | compare.py:11:8:11:19 | ControlFlowNode for Compare | ControlFlowNode for FloatLiteral | False |
| compare.py | 11 | compare.py:11:8:11:19 | ControlFlowNode for Compare | ControlFlowNode for IntegerLiteral | True |
| compare.py | 17 | compare.py:17:8:17:23 | ControlFlowNode for Compare | ControlFlowNode for FloatLiteral | False |
| compare.py | 17 | compare.py:17:8:17:23 | ControlFlowNode for Compare | ControlFlowNode for IntegerLiteral | True |
| true_false_test.py | 3 | true_false_test.py:3:8:3:12 | ControlFlowNode for cond1 | ControlFlowNode for cond2 | False |
| true_false_test.py | 3 | true_false_test.py:3:8:3:12 | ControlFlowNode for cond1 | ControlFlowNode for true1 | True |
| true_false_test.py | 5 | true_false_test.py:5:8:5:12 | ControlFlowNode for cond2 | ControlFlowNode for Pass | True |

View File

@@ -0,0 +1,20 @@
def contains1(item, cont):
assert item in cont
return 1
def contains2(item, cont):
assert item not in cont
return 2
def contains3(item, cont):
if item in cont:
return 3
else:
return 3.0
def contains4(item, cont):
if item not in cont:
return 4
else:
return 4.0