Disallow empty CircularBuffer setup (#5214)

This commit is contained in:
Ernesto García
2024-09-19 11:20:04 -06:00
committed by GitHub
parent b1f6bbe69f
commit 530179a71f
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);