Skip to content

Commit

Permalink
create test/libraries (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds authored Mar 26, 2024
1 parent 85cee79 commit a7f2c74
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion test/BitMath.t.sol β†’ test/libraries/BitMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.20;

import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol";
import {Test} from "forge-std/Test.sol";
import {BitMath} from "../src/libraries/BitMath.sol";
import {BitMath} from "src/libraries/BitMath.sol";

contract TestBitMath is Test, GasSnapshot {
function testMostSignificantBitZero() public {
Expand Down
2 changes: 1 addition & 1 deletion test/FullMath.t.sol β†’ test/libraries/FullMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.19;

import {Test} from "forge-std/Test.sol";
import {FullMath} from "../src/libraries/FullMath.sol";
import {FullMath} from "src/libraries/FullMath.sol";

contract FullMathTest is Test {
using FullMath for uint256;
Expand Down
30 changes: 15 additions & 15 deletions test/Hooks.t.sol β†’ test/libraries/Hooks.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ pragma solidity ^0.8.20;
import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol";
import {Test} from "forge-std/Test.sol";
import {Vm} from "forge-std/Vm.sol";
import {Hooks} from "../src/libraries/Hooks.sol";
import {SwapFeeLibrary} from "../src/libraries/SwapFeeLibrary.sol";
import {MockHooks} from "../src/test/MockHooks.sol";
import {IPoolManager} from "../src/interfaces/IPoolManager.sol";
import {Hooks} from "src/libraries/Hooks.sol";
import {SwapFeeLibrary} from "src/libraries/SwapFeeLibrary.sol";
import {MockHooks} from "src/test/MockHooks.sol";
import {IPoolManager} from "src/interfaces/IPoolManager.sol";
import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol";
import {IHooks} from "../src/interfaces/IHooks.sol";
import {Currency} from "../src/types/Currency.sol";
import {PoolManager} from "../src/PoolManager.sol";
import {PoolSwapTest} from "../src/test/PoolSwapTest.sol";
import {PoolDonateTest} from "../src/test/PoolDonateTest.sol";
import {Deployers} from "./utils/Deployers.sol";
import {ProtocolFees} from "../src/ProtocolFees.sol";
import {PoolId, PoolIdLibrary} from "../src/types/PoolId.sol";
import {PoolKey} from "../src/types/PoolKey.sol";
import {IERC20Minimal} from "../src/interfaces/external/IERC20Minimal.sol";
import {BalanceDelta} from "../src/types/BalanceDelta.sol";
import {IHooks} from "src/interfaces/IHooks.sol";
import {Currency} from "src/types/Currency.sol";
import {PoolManager} from "src/PoolManager.sol";
import {PoolSwapTest} from "src/test/PoolSwapTest.sol";
import {PoolDonateTest} from "src/test/PoolDonateTest.sol";
import {Deployers} from "test/utils/Deployers.sol";
import {ProtocolFees} from "src/ProtocolFees.sol";
import {PoolId, PoolIdLibrary} from "src/types/PoolId.sol";
import {PoolKey} from "src/types/PoolKey.sol";
import {IERC20Minimal} from "src/interfaces/external/IERC20Minimal.sol";
import {BalanceDelta} from "src/types/BalanceDelta.sol";

contract HooksTest is Test, Deployers, GasSnapshot {
using PoolIdLibrary for PoolKey;
Expand Down
2 changes: 1 addition & 1 deletion test/Lock.t.sol β†’ test/libraries/Lock.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Lock} from "../src/libraries/Lock.sol";
import {Lock} from "src/libraries/Lock.sol";

contract LockTest is Test {
function test_lock() public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {NonZeroDeltaCount} from "../src/libraries/NonZeroDeltaCount.sol";
import {NonZeroDeltaCount} from "src/libraries/NonZeroDeltaCount.sol";

contract NonZeroDeltaCountTest is Test {
address constant ADDRESS_AS = 0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa;
Expand Down
16 changes: 8 additions & 8 deletions test/Pool.t.sol β†’ test/libraries/Pool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vm} from "forge-std/Vm.sol";
import {Pool} from "../src/libraries/Pool.sol";
import {PoolManager} from "../src/PoolManager.sol";
import {Position} from "../src/libraries/Position.sol";
import {TickMath} from "../src/libraries/TickMath.sol";
import {TickBitmap} from "../src/libraries/TickBitmap.sol";
import {LiquidityAmounts} from "./utils/LiquidityAmounts.sol";
import {Constants} from "./utils/Constants.sol";
import {SafeCast} from "../src/libraries/SafeCast.sol";
import {Pool} from "src/libraries/Pool.sol";
import {PoolManager} from "src/PoolManager.sol";
import {Position} from "src/libraries/Position.sol";
import {TickMath} from "src/libraries/TickMath.sol";
import {TickBitmap} from "src/libraries/TickBitmap.sol";
import {LiquidityAmounts} from "test/utils/LiquidityAmounts.sol";
import {Constants} from "test/utils/Constants.sol";
import {SafeCast} from "src/libraries/SafeCast.sol";

contract PoolTest is Test {
using Pool for Pool.State;
Expand Down
2 changes: 1 addition & 1 deletion test/SafeCast.t.sol β†’ test/libraries/SafeCast.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vm} from "forge-std/Vm.sol";
import {SafeCast} from "../src/libraries/SafeCast.sol";
import {SafeCast} from "src/libraries/SafeCast.sol";

contract SafeCastTest is Test {
function testToUint160(uint256 x) public {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pragma solidity ^0.8.20;
import "forge-std/console.sol";
import {Test} from "forge-std/Test.sol";
import {Vm} from "forge-std/Vm.sol";
import {GasSnapshot} from "../lib/forge-gas-snapshot/src/GasSnapshot.sol";
import {SqrtPriceMath} from "../src/libraries/SqrtPriceMath.sol";
import {Constants} from "./utils/Constants.sol";
import {GasSnapshot} from "lib/forge-gas-snapshot/src/GasSnapshot.sol";
import {SqrtPriceMath} from "src/libraries/SqrtPriceMath.sol";
import {Constants} from "test/utils/Constants.sol";

contract SqrtPriceMathTestTest is Test, GasSnapshot {
function test_getNextSqrtPriceFromInput_revertsIfPriceIsZero() public {
Expand Down
4 changes: 2 additions & 2 deletions test/SwapMath.t.sol β†’ test/libraries/SwapMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vm} from "forge-std/Vm.sol";
import {SqrtPriceMath} from "../src/libraries/SqrtPriceMath.sol";
import {SwapMath} from "../src/libraries/SwapMath.sol";
import {SqrtPriceMath} from "src/libraries/SqrtPriceMath.sol";
import {SwapMath} from "src/libraries/SwapMath.sol";
import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol";

contract SwapMathTest is Test, GasSnapshot {
Expand Down
4 changes: 2 additions & 2 deletions test/TickBitmap.t.sol β†’ test/libraries/TickBitmap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vm} from "forge-std/Vm.sol";
import {GasSnapshot} from "../lib/forge-gas-snapshot/src/GasSnapshot.sol";
import {TickBitmap} from "../src/libraries/TickBitmap.sol";
import {GasSnapshot} from "lib/forge-gas-snapshot/src/GasSnapshot.sol";
import {TickBitmap} from "src/libraries/TickBitmap.sol";

contract TickBitmapTest is Test, GasSnapshot {
using TickBitmap for mapping(int16 => uint256);
Expand Down
6 changes: 3 additions & 3 deletions test/TickMath.t.sol β†’ test/libraries/TickMath.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Vm} from "forge-std/Vm.sol";
import {TickMathTest} from "../src/test/TickMathTest.sol";
import {TickMath} from "../src/libraries/TickMath.sol";
import {JavascriptFfi} from "./utils/JavascriptFfi.sol";
import {TickMathTest} from "src/test/TickMathTest.sol";
import {TickMath} from "src/libraries/TickMath.sol";
import {JavascriptFfi} from "test/utils/JavascriptFfi.sol";

contract TickMathTestTest is Test, JavascriptFfi {
int24 constant MIN_TICK = -887272;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
pragma solidity ^0.8.20;

import {Test} from "forge-std/Test.sol";
import {Deployers} from "./utils/Deployers.sol";
import {Deployers} from "test/utils/Deployers.sol";
import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol";
import {Action} from "../src/test/PoolNestedActionsTest.sol";
import {IHooks} from "../src/interfaces/IHooks.sol";
import {Action} from "src/test/PoolNestedActionsTest.sol";
import {IHooks} from "src/interfaces/IHooks.sol";

contract NestedActions is Test, Deployers, GasSnapshot {
Action[] actions;
Expand Down

0 comments on commit a7f2c74

Please sign in to comment.