Skip to content

Commit

Permalink
test: add testLoupeFacetAddressesEqualsTheListOfAvailableFacets
Browse files Browse the repository at this point in the history
Increases DiamondLoupeFacet test coverage to 100%.
  • Loading branch information
gitcoindev committed Dec 22, 2023
1 parent f6bd4c9 commit 6bd724d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/contracts/test/diamond/DiamondTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ contract TestDiamond is DiamondTestSetup {
}
}

function testLoupeFacetAddressesEqualsTheListOfAvailableFacets() public {
address[] memory facetAddresses = diamondLoupeFacet.facetAddresses();
Facet[] memory facets = diamondLoupeFacet.facets();

for (uint256 i = 0; i < facetAddresses.length; i++) {
assertEq(facets[i].facetAddress, facetAddresses[i]);
}
}

function testSelectors_ShouldBeAssociatedWithCorrectFacet() public {
for (uint256 i; i < facetAddressList.length; i++) {
if (compareStrings(facetNames[i], "DiamondCutFacet")) {
Expand Down

0 comments on commit 6bd724d

Please sign in to comment.