Skip to content

Commit

Permalink
Improve maxCycles test coverage (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeSandwich committed Oct 11, 2023
1 parent 6743435 commit dbce0cc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/Streams.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,25 @@ contract StreamsTest is Test, PseudoRandomUtils, Streams {
receiveStreams(receiver, _cycleSecs);
}

function testReceiveAllStreamsCyclesWithLowMaxCycles() public {
// Enough for 3 cycles
uint128 amt = _cycleSecs * 3;
skipToCycleEnd();
setStreams(sender, 0, amt, recv(receiver, 1), _cycleSecs * 3);
skipToCycleEnd();
skipToCycleEnd();
skipToCycleEnd();
receiveStreams({
accountId: receiver,
maxCycles: 4,
expectedReceivedAmt: _cycleSecs * 3,
expectedReceivedCycles: 3,
expectedAmtAfter: 0,
expectedCyclesAfter: 0
});
receiveStreams(receiver, 0);
}

function testSenderCanStreamToThemselves() public {
uint128 amt = _cycleSecs * 3;
skipToCycleEnd();
Expand Down

0 comments on commit dbce0cc

Please sign in to comment.