diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-18 07:09:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-18 07:09:32 -0300 |
| commit | f0e6eb0de0b5ac9f81ba2c728f3040c4a51ab284 (patch) | |
| tree | e2660cddde27b7dc03240e6c56ceefad1ffc35fe /test/behaviour | |
| parent | 3350156db428656fa8e583d1971663e1c4a215b0 (diff) | |
| download | pardes-f0e6eb0de0b5ac9f81ba2c728f3040c4a51ab284.tar.gz pardes-f0e6eb0de0b5ac9f81ba2c728f3040c4a51ab284.zip | |
kinds: a kind's job tokens are the session's on every core, a client's plain kind keeps no job's input, and a PDF render's pixels go with the document they are of: Slot.tokens is dumped and digested (a client joined later numbers its next job as the session does; a Shadow takes it from the call's outcome), api.job on a replica gives the token alone (it runs no job, so its four input slots filled and it refused the fifth while the session asked on), and a render's answer names its document, so one that lands after its pane opened its file again (changed on disk) no longer frees pixels the old document freed with it (a double free, ABRT in the new behaviour test without the fix); kitty-harness's panic placed: the base's (the harness panics before its first line when NO_COLOR is in its environment, as zig build gives it; run by hand without it, it passes on the base and on this tree); tui core-test 820/959 (139 skipped), shell-test 994/997, behaviour-test 274/274 and --replay 0 failures, pane-test 180/181, addon-test 1/1, replicas pass (checked/wrong 0)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/behaviour')
| -rw-r--r-- | test/behaviour/addons_pdf.zig | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/behaviour/addons_pdf.zig b/test/behaviour/addons_pdf.zig index 23768f61..af194a5b 100644 --- a/test/behaviour/addons_pdf.zig +++ b/test/behaviour/addons_pdf.zig @@ -256,3 +256,29 @@ test "addons: a PDF whose file changes on disk shows its new pages, under new ke try std.testing.expect(now.len >= 1); for (now) |pic| for (first) |old| try std.testing.expect(!std.mem.eql(u8, pic.key, old.key)); } + +test "addons: a PDF whose file changes on disk while a page of it renders: the pixels go with the document they are of, once" { + var s = try Session.initFile(std.testing.allocator, "x\n"); + defer s.deinit(); + s.graphics(); + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var buf: [4096]u8 = undefined; + const dir = buf[0..try tmp.dir.realPath(std.testing.io, &buf)]; + const a = s.arena.allocator(); + const links = try std.Io.Dir.cwd().readFileAlloc(std.testing.io, "test/pdf-fixtures/links.pdf", a, .unlimited); + const outline = try std.Io.Dir.cwd().readFileAlloc(std.testing.io, "test/pdf-fixtures/outline.pdf", a, .unlimited); + try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "doc.pdf", .data = links }); + const n = try s.lookFile(s.at("{s}/doc.pdf", .{dir})); + try std.testing.expect((try shown(&s, n)).len >= 1); + // A page drawn again (another tint), its render done on a worker but + // not yet answered as the file changes and the pane opens it again. + s.hold_jobs = true; + try s.write(s.at("/pane/{d}/ctl", .{n}), "PdfTint full\n"); + s.runJobs(); + try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "doc.pdf", .data = outline }); + try std.testing.expect(try s.filesChanged()); + s.releaseJobs(); + try s.keys("0"); + try std.testing.expect((try shown(&s, n)).len >= 1); +} |
