Disallow empty CircularBuffer setup (#5214)

Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Ernesto García
2024-09-19 11:20:04 -06:00
committed by Hadrien Croubois
parent 824a295d1c
commit 6b1936de73
2 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,10 @@ describe('CircularBuffer', function () {
Object.assign(this, await loadFixture(fixture));
});
it('reverts on invalid setup', async function () {
await expect(this.mock.$setup(0, 0)).to.be.revertedWithCustomError(this.mock, 'InvalidBufferSize');
});
it('starts empty', async function () {
expect(await this.mock.$count(0)).to.equal(0n);
expect(await this.mock.$length(0)).to.equal(LENGTH);