Versions 258 to 318
Lines 163–165 at 318 (were 163–186 at 258)
166−
167−test("a collection read straight through is never kept, and pushes nothing out (abso Capacity)", () => {
168− const source = new SqlState();
169− try {
170− const cache = new CachedStateStorage(source, 8192, 2, 8192, (collection) => collection === "pages");
171− source.write("rows", "a", "A");
172− source.write("rows", "b", "B");
173− for (let i = 0; i < 10; i++) source.write("pages", String(i), [i]);
174− cache.read("rows", "a");
175− cache.read("rows", "b");
176− const reads = source.reads;
177− for (let i = 0; i < 10; i++) assert.deepEqual(cache.read("pages", String(i)), [i]);
178− assert.equal(source.reads, reads + 10);
179− assert.equal(cache.read("rows", "a"), "A");
180− assert.equal(cache.read("rows", "b"), "B");
181− assert.equal(source.reads, reads + 10, "the two kept rows were not pushed out by the pages");
182− assert.equal(cache.retainedEntries, 2);
183− } finally {
184− source.db.close();
185− }
186−});
- MCP
- compare on this site's /mcp
- CLI
- abso diff 258 318 src/engine/test/state-cache.test.ts --json
- JSON
- /christopher/abso-core/compare/258..318?file=src%2Fengine%2Ftest%2Fstate-cache.test.ts&format=json