Skip to content

Commit 898afe7

Browse files
committed
test(cache): add multidimensional array boundary test
1 parent 6a3d87e commit 898afe7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

lib/cache.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,21 @@ describe('TTLCache', () => {
403403
cache.destroy();
404404
});
405405

406+
it('stores and retrieves multidimensional array values', () => {
407+
const cache = new TTLCache<number[][]>();
408+
409+
const matrix = [
410+
[1, 2],
411+
[3, 4],
412+
];
413+
414+
cache.set('matrix', matrix, 60_000);
415+
416+
expect(cache.get('matrix')).toEqual(matrix);
417+
418+
cache.destroy();
419+
});
420+
406421
it('stores and retrieves values using unicode cache keys', () => {
407422
const cache = new TTLCache<string>();
408423

0 commit comments

Comments
 (0)