silverbullet/common/spaces/deno_kv_space_primitives.te...

13 lines
596 B
TypeScript
Raw Normal View History

import { DenoKvPrimitives } from "$lib/data/deno_kv_primitives.ts";
import { ChunkedKvStoreSpacePrimitives } from "$common/spaces/chunked_datastore_space_primitives.ts";
import { testSpacePrimitives } from "$common/spaces/space_primitives.test.ts";
2023-08-20 23:51:00 +08:00
Deno.test("deno kv test", async () => {
2023-08-20 23:51:00 +08: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 23:51:00 +08:00
await Deno.remove(tempFile);
});