Ver código fonte

Improve error granularity of EnumerableMap behavior tests (#5581)

Hadrien Croubois 6 meses atrás
pai
commit
fda6b85f2c
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      test/utils/structs/EnumerableMap.behavior.js

+ 6 - 2
test/utils/structs/EnumerableMap.behavior.js

@@ -172,8 +172,12 @@ function shouldBehaveLikeMap() {
 
       it('missing value', async function () {
         await expect(this.methods.get(this.keyB))
-          .to.be.revertedWithCustomError(this.mock, 'EnumerableMapNonexistentKey')
-          .withArgs(ethers.AbiCoder.defaultAbiCoder().encode([this.keyType], [this.keyB]));
+          .to.be.revertedWithCustomError(this.mock, this.error ?? 'EnumerableMapNonexistentKey')
+          .withArgs(
+            this.key?.memory || this.value?.memory
+              ? this.keyB
+              : ethers.AbiCoder.defaultAbiCoder().encode([this.keyType], [this.keyB]),
+          );
       });
     });