1
0
silverbullet/common/spaces/deno_kv_space_primitives.test.ts

13 lines
577 B
TypeScript
Raw Normal View History

import { DenoKvPrimitives } from "../../plugos/lib/deno_kv_primitives.ts";
import { ChunkedKvStoreSpacePrimitives } from "./chunked_datastore_space_primitives.ts";
import { testSpacePrimitives } from "./space_primitives.test.ts";
2023-08-20 15:51:00 +00:00
Deno.test("deno kv test", async () => {
2023-08-20 15:51:00 +00:00
const tempFile = await Deno.makeTempFile({ suffix: ".db" });
const denoKv = new DenoKvPrimitives(await Deno.openKv(tempFile));
const spacePrimitives = new ChunkedKvStoreSpacePrimitives(denoKv, 65536);
await testSpacePrimitives(spacePrimitives);
denoKv.close();
2023-08-20 15:51:00 +00:00
await Deno.remove(tempFile);
});