Skip to content

Commit

Permalink
better messages and names for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Oct 4, 2023
1 parent 02e5bf0 commit cc4d699
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/test/Counter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ contract CounterTest is Test {

if (index > 1) {
value = counters.get(index - 1);
assertEq(value, index - 1, "check previous set before");
assertEq(value, index - 1, "check the counter previously set before update");
}
counters.set(index, index);
value = counters.get(index);
assertEq(value, index, "check current set");
assertEq(value, index, "check counter set now");
if (index > 1) {
value = counters.get(index - 1);
assertEq(value, index - 1, "check previous set after");
assertEq(value, index - 1, "check previous previous counter after the current set");
}
}
for (uint16 index = 0; index < 32; index++) {
Expand All @@ -78,12 +78,12 @@ contract CounterTest is Test {

if (index > 1) {
value = counters.get(index - 1);
assertEq(value, index, "check previous set after second iteration");
assertEq(value, index, "check previous counter set after second set");
}
}
}

function testCounterGetAndSetNotMatch() public {
function testCounterGetAndSetWithTwoIterations() public {
counters = Counter.createCounter(300);
uint256 index = 0;
uint16 value = 11;
Expand Down

0 comments on commit cc4d699

Please sign in to comment.