|
1 | 1 | /**
|
2 |
| - * Copyright 2022, Optimizely |
| 2 | + * Copyright 2022, 2024 Optimizely |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -242,28 +242,28 @@ describe('/lib/core/odp/lru_cache (Default)', () => {
|
242 | 242 | await sleep(150);
|
243 | 243 |
|
244 | 244 | assert.equal(cache.map.size, 0);
|
| 245 | + }); |
245 | 246 |
|
246 |
| - it('should be fully functional after resetting the cache', () => { |
247 |
| - cache.save({ key: 'c', value: 300 }); // { c: 300 } |
248 |
| - cache.save({ key: 'd', value: 400 }); // { c: 300, d: 400 } |
249 |
| - assert.isNull(cache.peek('b')); |
250 |
| - assert.equal(cache.peek('c'), 300); |
251 |
| - assert.equal(cache.peek('d'), 400); |
252 |
| - |
253 |
| - cache.save({ key: 'a', value: 500 }); // { d: 400, a: 500 } |
254 |
| - cache.save({ key: 'b', value: 600 }); // { a: 500, b: 600 } |
255 |
| - assert.isNull(cache.peek('c')); |
256 |
| - assert.equal(cache.peek('a'), 500); |
257 |
| - assert.equal(cache.peek('b'), 600); |
258 |
| - |
259 |
| - const _ = cache.lookup('a'); // { b: 600, a: 500 } |
260 |
| - assert.equal(500, _); |
261 |
| - |
262 |
| - cache.save({ key: 'c', value: 700 }); // { a: 500, c: 700 } |
263 |
| - assert.isNull(cache.peek('b')); |
264 |
| - assert.equal(cache.peek('a'), 500); |
265 |
| - assert.equal(cache.peek('c'), 700); |
266 |
| - }); |
| 247 | + it('should be fully functional after resetting the cache', () => { |
| 248 | + cache.save({ key: 'c', value: 300 }); // { c: 300 } |
| 249 | + cache.save({ key: 'd', value: 400 }); // { c: 300, d: 400 } |
| 250 | + assert.isNull(cache.peek('b')); |
| 251 | + assert.equal(cache.peek('c'), 300); |
| 252 | + assert.equal(cache.peek('d'), 400); |
| 253 | + |
| 254 | + cache.save({ key: 'a', value: 500 }); // { d: 400, a: 500 } |
| 255 | + cache.save({ key: 'b', value: 600 }); // { a: 500, b: 600 } |
| 256 | + assert.isNull(cache.peek('c')); |
| 257 | + assert.equal(cache.peek('a'), 500); |
| 258 | + assert.equal(cache.peek('b'), 600); |
| 259 | + |
| 260 | + const _ = cache.lookup('a'); // { b: 600, a: 500 } |
| 261 | + assert.equal(500, _); |
| 262 | + |
| 263 | + cache.save({ key: 'c', value: 700 }); // { a: 500, c: 700 } |
| 264 | + assert.isNull(cache.peek('b')); |
| 265 | + assert.equal(cache.peek('a'), 500); |
| 266 | + assert.equal(cache.peek('c'), 700); |
267 | 267 | });
|
268 | 268 | });
|
269 | 269 | });
|
|
0 commit comments