2023-12-13 16:52:56 +00:00
|
|
|
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
|
|
|
|
2023-12-13 16:52:56 +00:00
|
|
|
Deno.test("deno kv test", async () => {
|
2023-08-20 15:51:00 +00:00
|
|
|
const tempFile = await Deno.makeTempFile({ suffix: ".db" });
|
2023-12-13 16:52:56 +00:00
|
|
|
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);
|
|
|
|
});
|