Skip to content

Commit

Permalink
Proper Return function in loop testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bannsec committed Apr 8, 2016
1 parent 52ec3a6 commit 50c3464
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_pyState_Call.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,28 @@ def test():
x = test().rstrip(s1).rstrip(s2)
"""

test14 = """
def test():
for x in range(10):
if x % 2 == 0:
return 0
return 1
x = test()
"""

def test_pySym_Return_Inside_Loop():
b = ast.parse(test14).body
p = Path(b,source=test14)
pg = PathGroup(p)

pg.explore()

assert len(pg.completed) == 1

assert pg.completed[0].state.any_int('x') == 0


def test_pySym_Chained_AttrCall_Symbolic():
b = ast.parse(test13).body
p = Path(b,source=test13)
Expand Down

0 comments on commit 50c3464

Please sign in to comment.