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 165 to 166

Compare

+24 −0 in 1 place
Lines 10–39 at 166 (were 10–15 at 165)
1010import { Repo } from "./helpers.ts";
1111import { SqlState } from "./storage-helper.ts";
1212
13+test("projected text streams lines and line lookup does not read file text", (t) => {
14+ const storage = new SqlState();
15+ t.after(() => storage.db.close());
16+ const text = `${"x".repeat(40000)}\nsecond\nthird\n`;
17+ const repo = Repo.init({ "f.txt": text, "empty.txt": "" });
18+ const graph = new Graph({ storage: new CachedStateStorage(storage) });
19+ graph.add(repo.graph.atom("a0"));
20+ const adapter = new ExperimentalMarkerProjection(storage, graph, "f.txt", "streamed-text");
21+ const state = adapter.apply(adapter.empty(), graph.atom("a0"));
22+ const reader = new ProjectionReader(adapter, state, () => {});
23+ t.mock.method(reader, "lines", () => {
24+ throw Error("full line array forbidden");
25+ });
26+ assert.equal(reader.text("f.txt"), text);
27+ assert.equal(reader.text("empty.txt"), "");
28+ assert.equal(reader.text("missing.txt"), "");
29+ const ids = [...adapter.lineIds(state, "f.txt")];
30+ t.mock.method(graph, "textOf", () => {
31+ throw Error("line lookup must not read text");
32+ });
33+ for (let i = 0; i < ids.length; i++) assert.equal(reader.lineNumber("f.txt", ids[i]!), i);
34+ assert.equal(reader.lineNumber("f.txt", "missing"), -1);
35+});
1337test("unchanged atom builder consumes the private reader for replacement and insertion edits", () => {
1438 const storage = new SqlState();
1539 try {
MCP
compare on this site's /mcp
CLI
abso diff 165 166 src/engine/test/projection-reader.test.ts --json
JSON
/christopher/abso-core/compare/165..166?file=src%2Fengine%2Ftest%2Fprojection-reader.test.ts&format=json