mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
refactor: move code
This commit is contained in:
@@ -269,18 +269,16 @@ describe('Sorted Set methods', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should work with big arrays (length > 100) ', async function () {
|
it('should work with big arrays (length > 100) ', async function () {
|
||||||
|
const keys = [];
|
||||||
for (let i = 0; i < 400; i++) {
|
for (let i = 0; i < 400; i++) {
|
||||||
/* eslint-disable no-await-in-loop */
|
/* eslint-disable no-await-in-loop */
|
||||||
const bulkAdd = [];
|
const bulkAdd = [];
|
||||||
|
keys.push('testzset' + i);
|
||||||
for (let k = 0; k < 100; k++) {
|
for (let k = 0; k < 100; k++) {
|
||||||
bulkAdd.push(['testzset' + i, 1000000 + k + (i * 100), k + (i * 100)]);
|
bulkAdd.push(['testzset' + i, 1000000 + k + (i * 100), k + (i * 100)]);
|
||||||
}
|
}
|
||||||
await db.sortedSetAddBulk(bulkAdd);
|
await db.sortedSetAddBulk(bulkAdd);
|
||||||
}
|
}
|
||||||
const keys = [];
|
|
||||||
for (let i = 0; i < 400; i++) {
|
|
||||||
keys.push('testzset' + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
let data = await db.getSortedSetRevRange(keys, 0, 3);
|
let data = await db.getSortedSetRevRange(keys, 0, 3);
|
||||||
assert.deepStrictEqual(data, ['39999', '39998', '39997', '39996']);
|
assert.deepStrictEqual(data, ['39999', '39998', '39997', '39996']);
|
||||||
|
|||||||
Reference in New Issue
Block a user