Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 2 to 318

Compare

+35 −0 in 1 place
new file, 35 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { answer } from "../../worker/project/http.ts";
4+import { DiskFirstRuntime } from "../src/disk-first-runtime.ts";
5+import { memoryStorage } from "./helpers.ts";
6+
7+test("disk runtime moves a text file without using a stale reader", (t) => {
8+ const storage = memoryStorage();
9+ t.after(() => storage.db.close());
10+ const runtime = () => new DiskFirstRuntime(storage, "move", "move");
11+ runtime().initialize(
12+ (c) => answer(c, "init", undefined, { files: { "a.txt": "one\ntwo\n" } }),
13+ () => {},
14+ );
15+ while (!runtime().preparePage(() => {}).ready) {}
16+ const result = runtime().write(
17+ (c) => answer(c, "move", "alice", { from: "a.txt", to: "b.txt" }),
18+ () => {},
19+ );
20+ assert.equal(result.status, 200, JSON.stringify(result));
21+ assert.equal(
22+ runtime().write(
23+ (c) => answer(c, "publish", "alice", { message: "move" }),
24+ () => {},
25+ ).status,
26+ 200,
27+ );
28+ assert.deepEqual(
29+ runtime().read(
30+ (c) => c.shared().files,
31+ () => {},
32+ ),
33+ { "b.txt": "one\ntwo\n" },
34+ );
35+});
MCP
compare on this site's /mcp
CLI
abso diff 2 318 server/test/projected-move.test.ts --json
JSON
/christopher/abso-core/compare/2..318?file=server%2Ftest%2Fprojected-move.test.ts&format=json