Skip to content

Commit be3e760

Browse files
committed
Improve error granularity of EnumerableMap behavior tests
1 parent 8a4eade commit be3e760

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/utils/structs/EnumerableMap.behavior.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,12 @@ function shouldBehaveLikeMap() {
172172

173173
it('missing value', async function () {
174174
await expect(this.methods.get(this.keyB))
175-
.to.be.revertedWithCustomError(this.mock, 'EnumerableMapNonexistentKey')
176-
.withArgs(ethers.AbiCoder.defaultAbiCoder().encode([this.keyType], [this.keyB]));
175+
.to.be.revertedWithCustomError(this.mock, this.error ?? 'EnumerableMapNonexistentKey')
176+
.withArgs(
177+
this.key?.memory || this.value?.memory
178+
? this.keyB
179+
: ethers.AbiCoder.defaultAbiCoder().encode([this.keyType], [this.keyB]),
180+
);
177181
});
178182
});
179183

0 commit comments

Comments
 (0)