Skip to content

Commit

Permalink
update test to have better coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dwightguth committed Aug 26, 2024
1 parent 9441a50 commit c77bc8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/regression/if.ref
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
.List
</contract-fn-return-names>
<contract-fn-body>
bool x = true ; if ( x ) { .Statements } else { require ( false , "" , .TypedVals ) ; .Statements } x = false ; if ( x ) { require ( false , "" , .TypedVals ) ; .Statements } else { .Statements } if ( x ) { require ( false , "" , .TypedVals ) ; .Statements } .Statements
bool x = true ; bool y = false ; if ( x ) { y = true ; .Statements } else { require ( false , "" , .TypedVals ) ; .Statements } require ( y , "" , .TypedVals ) ; y = false ; x = false ; if ( x ) { require ( false , "" , .TypedVals ) ; .Statements } else { y = true ; .Statements } require ( y , "" , .TypedVals ) ; if ( x ) { require ( false , "" , .TypedVals ) ; .Statements } .Statements
</contract-fn-body>
</contract-fn>
</contract-fns>
Expand All @@ -67,9 +67,11 @@
</this-type>
<env>
x |-> var ( 0 , bool )
y |-> var ( 1 , bool )
</env>
<store>
0 |-> false
1 |-> true
</store>
<call-stack>
.List
Expand Down
6 changes: 6 additions & 0 deletions test/regression/if.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ contract IfTest {

constructor() {
bool x = true;
bool y = false;
if (x) {
y = true;
} else {
require(false, "");
}
require(y, "");
y = false;
x = false;
if (x) {
require(false, "");
} else {
y = true;
}
require(y, "");
if (x) {
require(false, "");
}
Expand Down

0 comments on commit c77bc8a

Please sign in to comment.