Skip to content

Commit

Permalink
test: use given keyword in test contracts and brancing trees
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Jul 31, 2023
1 parent ccbc3bc commit b3c9b8a
Show file tree
Hide file tree
Showing 92 changed files with 1,040 additions and 1,030 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is
}

/// @dev it should revert.
function test_RevertWhen_LoopCalculationOverflowsBlockGasLimit() external whenNotDelegateCalled {
function test_RevertWhen_LoopCalculationOverflowsBlockGasLimit() external givenNotDelegateCalled {
LockupDynamic.SegmentWithDelta[] memory segments = new LockupDynamic.SegmentWithDelta[](250_000);
vm.expectRevert(bytes(""));
createDefaultStreamWithDeltas(segments);
}

function test_RevertWhen_DeltasZero()
external
whenNotDelegateCalled
whenLoopCalculationsDoNotOverflowBlockGasLimit
givenNotDelegateCalled
givenLoopCalculationsDoNotOverflowBlockGasLimit
{
uint40 startTime = getBlockTimestamp();
LockupDynamic.SegmentWithDelta[] memory segments = defaults.createWithDeltas().segments;
Expand All @@ -60,9 +60,9 @@ contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is

function test_RevertWhen_MilestonesCalculationsOverflows_StartTimeNotLessThanFirstSegmentMilestone()
external
whenNotDelegateCalled
whenLoopCalculationsDoNotOverflowBlockGasLimit
whenDeltasNotZero
givenNotDelegateCalled
givenLoopCalculationsDoNotOverflowBlockGasLimit
givenDeltasNotZero
{
unchecked {
uint40 startTime = getBlockTimestamp();
Expand All @@ -81,9 +81,9 @@ contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is

function test_RevertWhen_MilestonesCalculationsOverflows_SegmentMilestonesNotOrdered()
external
whenNotDelegateCalled
whenLoopCalculationsDoNotOverflowBlockGasLimit
whenDeltasNotZero
givenNotDelegateCalled
givenLoopCalculationsDoNotOverflowBlockGasLimit
givenDeltasNotZero
{
unchecked {
uint40 startTime = getBlockTimestamp();
Expand Down Expand Up @@ -113,10 +113,10 @@ contract CreateWithDeltas_LockupDynamic_Integration_Concrete_Test is

function test_CreateWithDeltas()
external
whenNotDelegateCalled
whenLoopCalculationsDoNotOverflowBlockGasLimit
whenDeltasNotZero
whenMilestonesCalculationsDoNotOverflow
givenNotDelegateCalled
givenLoopCalculationsDoNotOverflowBlockGasLimit
givenDeltasNotZero
givenMilestonesCalculationsDoNotOverflow
{
// Make the Sender the stream's funder
address funder = users.sender;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
createWithDeltas.t.sol
├── when delegate called
├── given delegate called
│ └── it should revert
└── when not delegate called
└── given not delegate called
├── when the loop calculations overflow the block gas limit
│ └── it should revert
└── when the loop calculations do not overflow the block gas limit
└── given the loop calculations do not overflow the block gas limit
├── when at least one of the deltas at index one or greater is zero
│ └── it should revert
└── when none of the deltas is zero
├── when the segment milestone calculations overflow uint256
└── given none of the deltas is zero
├── given the segment milestone calculations overflow uint256
│ ├── when the start time is not less than the first segment milestone
│ │ └── it should revert
│ └── when the segment milestones are not ordered
Expand Down
Loading

0 comments on commit b3c9b8a

Please sign in to comment.