From c85228e7dc5b0f6b574ed75db7903c11b6c1847f Mon Sep 17 00:00:00 2001 From: dianakocsis Date: Tue, 29 Oct 2024 16:02:39 -0400 Subject: [PATCH] another test --- test/PositionDescriptor.t.sol | 6 ++++++ test/libraries/SVG.t.sol | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/test/PositionDescriptor.t.sol b/test/PositionDescriptor.t.sol index 495f280b..6c24a4af 100644 --- a/test/PositionDescriptor.t.sol +++ b/test/PositionDescriptor.t.sol @@ -125,6 +125,8 @@ contract PositionDescriptorTest is Test, PosmTestSetup, GasSnapshot { Token memory token = abi.decode(data, (Token)); // quote is currency1, base is currency0 + assertFalse(positionDescriptor.flipRatio(Currency.unwrap(key.currency0), Currency.unwrap(key.currency1))); + string memory symbol0 = SafeAddressMetadata.addressSymbol(Currency.unwrap(currency0), nativeCurrencyLabel); string memory symbol1 = SafeAddressMetadata.addressSymbol(Currency.unwrap(currency1), nativeCurrencyLabel); string memory managerAddress = toHexString(address(manager)); @@ -230,6 +232,10 @@ contract PositionDescriptorTest is Test, PosmTestSetup, GasSnapshot { Token memory token = abi.decode(data, (Token)); // quote is currency1, base is currency0 + assertFalse( + positionDescriptor.flipRatio(Currency.unwrap(nativeKey.currency0), Currency.unwrap(nativeKey.currency1)) + ); + string memory symbol0 = SafeAddressMetadata.addressSymbol(Currency.unwrap(nativeKey.currency0), nativeCurrencyLabel); string memory symbol1 = diff --git a/test/libraries/SVG.t.sol b/test/libraries/SVG.t.sol index c322483e..915557cb 100644 --- a/test/libraries/SVG.t.sol +++ b/test/libraries/SVG.t.sol @@ -47,4 +47,11 @@ contract DescriptorTest is Test { result = SVG.isRare(2, 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB); assertFalse(result); } + + function test_substring_succeeds() public pure { + string memory result = SVG.substring("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 0, 5); + assertEq(result, "0xC02"); + result = SVG.substring("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 39, 42); + assertEq(result, "Cc2"); + } }