File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -4137,9 +4137,32 @@ tests = testGroup "hevm"
4137
4137
]
4138
4138
, testGroup " equivalence-checking"
4139
4139
[
4140
+ test " eq-simple-diff" $ do
4141
+ Just a <- solcRuntime " C"
4142
+ [i |
4143
+ contract C {
4144
+ function stuff() public returns (uint256) {
4145
+ return 4;
4146
+ }
4147
+ }
4148
+ |]
4149
+ Just b <- solcRuntime " C"
4150
+ [i |
4151
+ contract C {
4152
+ function stuff() public returns (uint256) {
4153
+ return 5;
4154
+ }
4155
+ }
4156
+ |]
4157
+ withSolvers Bitwuzla 3 1 Nothing $ \ s -> do
4158
+ calldata <- mkCalldata Nothing []
4159
+ (res, _) <- equivalenceCheck s a b defaultVeriOpts calldata False
4160
+ assertBoolM " Must have a difference" (any isCex res)
4161
+ let cexs = mapMaybe getCex res
4162
+ assertEqualM " Must have exactly one cex" (length cexs) 1
4140
4163
-- diverging gas overapproximations are caught
4141
4164
-- previously, they had the same name (gas_...), so they compared equal
4142
- test " eq-divergent-overapprox-gas" $ do
4165
+ , test " eq-divergent-overapprox-gas" $ do
4143
4166
Just a <- solcRuntime " C"
4144
4167
[i |
4145
4168
contract C {
You can’t perform that action at this time.
0 commit comments