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
18 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 175, 1 version changed it

You're reading version 296. The newest is 318, and no version since then changed this file. Go to the newestCompare with 318

1import assert from "node:assert/strict";
2import { test } from "node:test";
3import { View } from "../../../src/engine/view.ts";
4import { MemoryStore, Project } from "../project.ts";
5
6test("move reconstruction does not join the intended whole file", (t) => {
7 const project = new Project(new MemoryStore());
8 project.init({ "a.txt": "header\nmove this line\nfooter\n", "b.txt": "destination\n" }, 0);
9 project.sync("writer");
10 assert.equal(project.edit("writer", { file: "a.txt", old: "move this line\n", new: "" }, 1).ok, true);
11 assert.equal(project.edit("writer", { file: "b.txt", content: "destination\nmove this line\n" }, 1).ok, true);
12 const whole = t.mock.method(View.prototype, "text", () => {
13 throw Error("whole file join forbidden");
14 });
15 assert.equal(project.publish("writer", "move", 2).ok, true);
16 whole.mock.restore();
17 assert.deepEqual(project.files(), { "a.txt": "header\nfooter\n", "b.txt": "destination\nmove this line\n" });
18});