From fda6b85f2c65d146b86d513a604554d15abd6679 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 13 Mar 2025 15:40:36 +0100 Subject: [PATCH] Improve error granularity of EnumerableMap behavior tests (#5581) --- test/utils/structs/EnumerableMap.behavior.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/utils/structs/EnumerableMap.behavior.js b/test/utils/structs/EnumerableMap.behavior.js index c80eec934..cf8de2e9d 100644 --- a/test/utils/structs/EnumerableMap.behavior.js +++ b/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]), + ); }); });