Skip to content

Commit

Permalink
another test
Browse files Browse the repository at this point in the history
  • Loading branch information
dianakocsis committed Oct 29, 2024
1 parent ea860c0 commit c85228e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/PositionDescriptor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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 =
Expand Down
7 changes: 7 additions & 0 deletions test/libraries/SVG.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

0 comments on commit c85228e

Please sign in to comment.