Improve error granularity of EnumerableMap behavior tests (#5581)

This commit is contained in:
Hadrien Croubois
2025-03-13 15:40:36 +01:00
committed by GitHub
parent 8a4eadea51
commit fda6b85f2c

View File

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