1
0
silverbullet/common/spaces/chunked_datastore_space_primitives.test.ts
Zef Hemel 9f082c83a9
Major backend refactor (#599)
Backend refactor
2023-12-13 17:52:56 +01:00

19 lines
809 B
TypeScript

import { MemoryKvPrimitives } from "../../plugos/lib/memory_kv_primitives.ts";
import { assertEquals } from "../../test_deps.ts";
import { ChunkedKvStoreSpacePrimitives } from "./chunked_datastore_space_primitives.ts";
import { testSpacePrimitives } from "./space_primitives.test.ts";
Deno.test("chunked_datastore_space_primitives", async () => {
const memoryKv = new MemoryKvPrimitives();
// In memory store and tiny chunks for testing
const spacePrimitives = new ChunkedKvStoreSpacePrimitives(memoryKv, 5);
await testSpacePrimitives(spacePrimitives);
const [deletedChunk] = await memoryKv.batchGet([[
"content",
"test.bin",
"000",
]]);
// This one was deleted during the test (but here we're checking the underlying store for content)
assertEquals(deletedChunk, undefined);
});