Skip to content

Commit

Permalink
Merge pull request #47 from mojtaba-eshghie/enhancement_issue_40
Browse files Browse the repository at this point in the history
Enhancement: #40 included tests for interesting cases;
  • Loading branch information
mojtaba-eshghie authored Sep 15, 2024
2 parents a2519f9 + b27fff0 commit cb67163
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
("msg.sender == msg.origin && a >= b", "msg.sender == msg.origin"),
("msg.sender == msg.origin", "msg.sender == msg.origin || a < b"),
("a == 1", "a >= 1"),
("a > b * 2", "a > b * 1")
("a > b * 2", "a > b * 1"),
("x > y", "x != y"),
],
'The second predicate is stronger.': [
("msg.sender == msg.origin || a < b", "a < b"),
("a > 12", "a > 13"),
("a + 1 <= b", "a + 1 < b"),
("a > b * 1/2", "a > b * 1"),
("coinMap[_coin].coinContract.balanceOf(msg.sender)>=_amount", "coinMap[_coin].coinContract.balanceOf(msg.sender)>=_amount*1e18")
("coinMap[_coin].coinContract.balanceOf(msg.sender)>=_amount", "coinMap[_coin].coinContract.balanceOf(msg.sender)>=_amount*1e18"),
("x >= y", "x == y"),
],
'The predicates are equivalent.': [
("msg.sender == msg.origin", "msg.origin == msg.sender"),
Expand All @@ -30,6 +32,8 @@
("NS<(1days)", "NS<NE"),
("super.balanceOf(to)+amount<=holdLimitAmount", "balanceOf(to)+amount<=holdLimitAmount"),
(" currentSupply+1<=MAX_SUPPLY", "currentSupply+boyzToUse.length<=MAX_SUPPLY"),
("x > y", "x == y"),
("x >= y", "x != y")
]
}

Expand Down

0 comments on commit cb67163

Please sign in to comment.