Skip to content

Commit

Permalink
test: add example test cases for redundant_assignment and missing_ret…
Browse files Browse the repository at this point in the history
…urn z3 options
  • Loading branch information
Raine-Yang-UofT committed Nov 4, 2024
1 parent 887565f commit 7b8658f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def func(x: int) -> int:
'''
Preconditions:
- x > 10
'''
a = 10
if x > 0: # by function precondition, this condition is True
a = 20 # `a` is reassigned before first use
return a
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def func(x: int) -> int:
'''
Preconditions:
- x in [1, 2, 3, 4, 5]
'''
if x > 5:
return x
print(x)

0 comments on commit 7b8658f

Please sign in to comment.