Skip to content

Commit

Permalink
test: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRBerg committed Dec 23, 2024
1 parent d4a95b0 commit e4e0a44
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/unit/concrete/batch/batch.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ contract Batch_Unit_Concrete_Test is Base_Test {
calls[0] = abi.encodeCall(batchMock.getNumber, ());
results = batchMock.batch(calls);

// It should return expected value.
assertEq(results.length, 1);
assertEq(abi.decode(results[0], (uint256)), 10);
// It should return the expected value.
assertEq(results.length, 1, "batch results length");
assertEq(abi.decode(results[0], (uint256)), 42, "batch results[0]");
}

modifier whenStateChangingFunction() {
Expand Down Expand Up @@ -81,8 +81,8 @@ contract Batch_Unit_Concrete_Test is Base_Test {
results = batchMock.batch(calls);

// It should return the empty string.
assertEq(results.length, 1);
assertEq(results[0], hex"");
assertEq(results.length, 1, "batch results length");
assertEq(results[0], hex"", "batch results[0]");
}

modifier whenPayable() {
Expand Down Expand Up @@ -123,8 +123,8 @@ contract Batch_Unit_Concrete_Test is Base_Test {
results = batchMock.batch{ value: 1 wei }(calls);

// It should return expected value.
assertEq(results.length, 1);
assertEq(abi.decode(results[0], (uint256)), newNumber);
assertEq(results.length, 1, "batch results length");
assertEq(abi.decode(results[0], (uint256)), newNumber, "batch results[0]");
}

function test_WhenFunctionDoesNotReturnAValue() external whenFunctionExists whenStateChangingFunction whenPayable {
Expand All @@ -133,7 +133,7 @@ contract Batch_Unit_Concrete_Test is Base_Test {
results = batchMock.batch{ value: 1 wei }(calls);

// It should return an empty value.
assertEq(results.length, 1);
assertEq(results[0], hex"");
assertEq(results.length, 1, "batch results length");
assertEq(results[0], hex"", "batch results[0]");
}
}

0 comments on commit e4e0a44

Please sign in to comment.