Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Use updated test names test_{function}_{case} #788

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/CustomAccounting.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ contract CustomAccountingTest is Test, Deployers, GasSnapshot {
assertEq(currency1.balanceOf(address(this)), balanceBefore1 + amountToSwap, "amount 1");
}

// maximum available liquidity in each direction for the pool in test_fuzz_swap_beforeSwap_returnsDeltaSpecified
// maximum available liquidity in each direction for the pool in test_swap_beforeSwap_returnsDeltaSpecified_fuzz
int128 maxPossibleIn_fuzz_test = -6018336102428409;
int128 maxPossibleOut_fuzz_test = 5981737760509662;

function test_fuzz_swap_beforeSwap_returnsDeltaSpecified(
function test_swap_beforeSwap_returnsDeltaSpecified_fuzz(
int128 hookDeltaSpecified,
int256 amountSpecified,
bool zeroForOne
Expand Down
2 changes: 1 addition & 1 deletion test/DynamicFees.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ contract TestDynamicFees is Test, Deployers, GasSnapshot {
assertEq(_fetchPoolLPFee(key), 123);
}

function test_fuzz_ProtocolAndLPFee(uint24 lpFee, uint16 protocolFee0, uint16 protocolFee1, int256 amountSpecified)
function test_ProtocolAndLPFee_fuzz(uint24 lpFee, uint16 protocolFee0, uint16 protocolFee1, int256 amountSpecified)
public
{
assertEq(_fetchPoolLPFee(key), 0);
Expand Down
2 changes: 1 addition & 1 deletion test/DynamicReturnFees.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract TestDynamicReturnFees is Test, Deployers, GasSnapshot {
);
}

function test_fuzz_dynamicReturnSwapFee(uint24 fee) public {
function test_dynamicReturnSwapFee_fuzz(uint24 fee) public {
// hook will handle adding the override flag
dynamicReturnFeesHook.setFee(fee);

Expand Down
4 changes: 2 additions & 2 deletions test/Extsload.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract ExtsloadTest is Test, GasSnapshot {
}
}

function test_fuzz_consecutiveExtsload(uint256 startSlot, uint256 length, uint256 seed) public {
function test_consecutiveExtsload_fuzz(uint256 startSlot, uint256 length, uint256 seed) public {
length = bound(length, 0, 1000);
startSlot = bound(startSlot, 0, type(uint256).max - length);
for (uint256 i; i < length; ++i) {
Expand All @@ -39,7 +39,7 @@ contract ExtsloadTest is Test, GasSnapshot {
}
}

function test_fuzz_extsload(uint256 length, uint256 seed, bytes memory dirtyBits) public {
function test_extsload_fuzz(uint256 length, uint256 seed, bytes memory dirtyBits) public {
length = bound(length, 0, 1000);
bytes32[] memory slots = new bytes32[](length);
bytes32[] memory expected = new bytes32[](length);
Expand Down
6 changes: 3 additions & 3 deletions test/ModifyLiquidity.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract ModifyLiquidityTest is Test, Logger, Deployers, JavascriptFfi, Fuzzers,
/// forge-config: default.fuzz.runs = 10
/// forge-config: pr.fuzz.runs = 10
/// forge-config: ci.fuzz.runs = 500
function test_ffi_fuzz_addLiquidity_defaultPool_ReturnsCorrectLiquidityDelta(
function test_ffi_addLiquidity_defaultPool_ReturnsCorrectLiquidityDelta_fuzz(
IPoolManager.ModifyLiquidityParams memory paramSeed
) public {
// Sanitize the fuzzed params to get valid tickLower, tickUpper, and liquidityDelta.
Expand Down Expand Up @@ -304,12 +304,12 @@ contract ModifyLiquidityTest is Test, Logger, Deployers, JavascriptFfi, Fuzzers,
assertEq(updatedPositionSalt.liquidity, uint128(uint256(LIQ_PARAM_SALT.liquidityDelta)));
}

function test_gas_modifyLiquidity_newPosition() public {
function test_modifyLiquidity_newPosition_gas() public {
modifyLiquidityRouter.modifyLiquidity(simpleKey, LIQ_PARAM_SALT, ZERO_BYTES);
snapLastCall("create new liquidity to a position with salt");
}

function test_gas_modifyLiquidity_updateSamePosition_withSalt() public {
function test_modifyLiquidity_updateSamePosition_withSalt_gas() public {
modifyLiquidityRouter.modifyLiquidity(simpleKey, LIQ_PARAM_SALT, ZERO_BYTES);
modifyLiquidityRouter.modifyLiquidity(simpleKey, LIQ_PARAM_SALT, ZERO_BYTES);
snapLastCall("add liquidity to already existing position with salt");
Expand Down
2 changes: 1 addition & 1 deletion test/NoDelegateCall.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract TestDelegateCall is Test, Deployers, GasSnapshot {
noDelegateCallTest = new NoDelegateCallTest();
}

function test_gas_noDelegateCall() public {
function test_noDelegateCall_gas() public {
snap(
"NoDelegateCall",
noDelegateCallTest.getGasCostOfCannotBeDelegateCalled()
Expand Down
2 changes: 1 addition & 1 deletion test/PoolManagerInitialize.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ contract PoolManagerInitializeTest is Test, Deployers, GasSnapshot {
});
}

function test_fuzz_initialize(PoolKey memory key0, uint160 sqrtPriceX96) public {
function test_initialize_fuzz(PoolKey memory key0, uint160 sqrtPriceX96) public {
// Assumptions tested in Pool.t.sol
sqrtPriceX96 = uint160(bound(sqrtPriceX96, TickMath.MIN_SQRT_PRICE, TickMath.MAX_SQRT_PRICE - 1));

Expand Down
6 changes: 3 additions & 3 deletions test/ProtocolFeesImplementation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers {
protocolFees.setProtocolFee(key, protocolFee);
}

function test_fuzz_setProtocolFee(PoolKey memory key, uint24 protocolFee) public {
function test_setProtocolFee_fuzz(PoolKey memory key, uint24 protocolFee) public {
protocolFees.setProtocolFeeController(feeController);
// Set price to pretend that the pool is initialized
protocolFees.setPrice(key, Constants.SQRT_PRICE_1_1);
Expand Down Expand Up @@ -123,7 +123,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers {
assertEq(currency0.balanceOf(address(this)), 100);
}

function test_fuzz_collectProtocolFees(address recipient, uint256 amount, uint256 feesAccrued) public {
function test_collectProtocolFees_fuzz(address recipient, uint256 amount, uint256 feesAccrued) public {
vm.assume(feesAccrued <= currency0.balanceOf(address(protocolFees)));

uint256 recipientBalanceBefore = currency0.balanceOf(recipient);
Expand Down Expand Up @@ -164,7 +164,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers {
assertEq(protocolFees.protocolFeesAccrued(currency0), 300);
}

function test_fuzz_updateProtocolFees(uint256 amount, uint256 startingAmount) public {
function test_updateProtocolFees_fuzz(uint256 amount, uint256 startingAmount) public {
// set a starting balance of protocol fees
protocolFees.updateProtocolFees(currency0, startingAmount);
assertEq(protocolFees.protocolFeesAccrued(currency0), startingAmount);
Expand Down
2 changes: 1 addition & 1 deletion test/SkipCallsTestHook.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ contract SkipCallsTest is Test, Deployers, GasSnapshot {
assertEq(skipCallsTestHook.counter(), 2);
}

function test_gas_beforeSwap_skipIfCalledByHook() public {
function test_beforeSwap_skipIfCalledByHook_gas() public {
SkipCallsTestHook skipCallsTestHook = SkipCallsTestHook(
address(uint160(type(uint160).max & clearAllHookPermissionsMask | Hooks.BEFORE_SWAP_FLAG))
);
Expand Down
4 changes: 2 additions & 2 deletions test/libraries/BitMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract TestBitMath is Test, GasSnapshot {
assertEq(BitMath.mostSignificantBit(type(uint256).max), 255);
}

function test_fuzz_mostSignificantBit(uint256 x) public pure {
function test_mostSignificantBit_fuzz(uint256 x) public pure {
vm.assume(x != 0);
assertEq(BitMath.mostSignificantBit(x), mostSignificantBitReference(x));
}
Expand Down Expand Up @@ -80,7 +80,7 @@ contract TestBitMath is Test, GasSnapshot {
assertEq(BitMath.leastSignificantBit(type(uint256).max), 0);
}

function test_fuzz_leastSignificantBit(uint256 x) public pure {
function test_leastSignificantBit_fuzz(uint256 x) public pure {
vm.assume(x != 0);
assertEq(BitMath.leastSignificantBit(x), leastSignificantBitReference(x));
}
Expand Down
8 changes: 4 additions & 4 deletions test/libraries/FullMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract FullMathTest is Test {
uint256 constant Q128 = 2 ** 128;
uint256 constant MAX_UINT256 = type(uint256).max;

function test_fuzz_mulDiv_revertsWith0Denominator(uint256 x, uint256 y) public {
function test_mulDiv_revertsWith0Denominator_fuzz(uint256 x, uint256 y) public {
vm.expectRevert();
x.mulDiv(y, 0);
}
Expand Down Expand Up @@ -49,14 +49,14 @@ contract FullMathTest is Test {
assertEq(Q128.mulDiv(1000 * Q128, 3000 * Q128), result);
}

function test_fuzz_mulDiv(uint256 x, uint256 y, uint256 d) public pure {
function test_mulDiv_fuzz(uint256 x, uint256 y, uint256 d) public pure {
vm.assume(d != 0);
vm.assume(y != 0);
x = bound(x, 0, type(uint256).max / y);
assertEq(FullMath.mulDiv(x, y, d), x * y / d);
}

function test_fuzz_mulDivRoundingUp_revertsWith0Denominator(uint256 x, uint256 y) public {
function test_mulDivRoundingUp_revertsWith0Denominator_fuzz(uint256 x, uint256 y) public {
vm.expectRevert();
x.mulDivRoundingUp(y, 0);
}
Expand Down Expand Up @@ -94,7 +94,7 @@ contract FullMathTest is Test {
);
}

function test_fuzz_mulDivRoundingUp(uint256 x, uint256 y, uint256 d) public pure {
function test_mulDivRoundingUp_fuzz(uint256 x, uint256 y, uint256 d) public pure {
vm.assume(d != 0);
vm.assume(y != 0);
x = bound(x, 0, type(uint256).max / y);
Expand Down
Loading
Loading