Add paginated version of EnumerableSet.values() and EnumerableMap.keys() (#5713)

Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Hadrien Croubois
2025-06-04 09:33:00 +02:00
committed by GitHub
parent f45e9158b7
commit d20b9e30bd
10 changed files with 472 additions and 4 deletions

View File

@ -152,6 +152,22 @@ function shouldBehaveLikeSet() {
await expectMembersMatch(this.methods, [this.valueA]);
});
});
it('values (full & paginated)', async function () {
const values = [this.valueA, this.valueB, this.valueC];
await this.methods.add(this.valueA);
await this.methods.add(this.valueB);
await this.methods.add(this.valueC);
// get all values
expect([...(await this.methods.values())]).to.deep.equal(values);
// try pagination
for (const begin of [0, 1, 2, 3, 4])
for (const end of [0, 1, 2, 3, 4]) {
expect([...(await this.methods.valuesPage(begin, end))]).to.deep.equal(values.slice(begin, end));
}
});
}
module.exports = {