Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoeilers committed Jan 25, 2024
1 parent fabb8dc commit 12f52b9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/nagini_translation/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ def visit_FunctionDef(self, node: ast.FunctionDef) -> None:
func.method_type = MethodType.class_method
self.current_class._has_classmethod = True
func.predicate = self.is_predicate(node)
if func.predicate:
func.contract_only = self.is_declared_contract_only(node)
if self.is_all_low(node):
self.has_all_low = True
func.all_low = True
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/translation/test_abstract_pred_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ def huhFunc(mc: MyClass) -> int:
Requires(huh(mc))
Ensures(Result() > 0)
#:: ExpectedOutput(invalid.program:abstract.predicate.fold)
return Unfold(huh(mc))
Unfold(huh(mc))
return 3
3 changes: 2 additions & 1 deletion tests/functional/translation/test_abstract_pred_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ def huh(mc: MyClass) -> bool:
def huhFunc(mc: MyClass) -> int:
Ensures(Result() > 0)
#:: ExpectedOutput(invalid.program:abstract.predicate.fold)
return Fold(huh(mc))
Fold(huh(mc))
return 4
3 changes: 2 additions & 1 deletion tests/functional/translation/test_abstract_pred_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ def huh(self) -> bool:
def huhFunc(mc: MyClass) -> int:
Ensures(Result() > 0)
#:: ExpectedOutput(invalid.program:abstract.predicate.fold)
return Fold(mc.huh())
Fold(mc.huh())
return 4

0 comments on commit 12f52b9

Please sign in to comment.