summaryrefslogtreecommitdiff
path: root/test/process
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 16:58:21 -0300
committerGabriel Schneider <[email protected]>2026-11-04 17:00:55 -0300
commit989a3120542c0a07831c2496d74bad1fc8e75cba (patch)
tree28113b5a4c840ec9a63bd080158331695e352983 /test/process
parentef0d017705146a74bf7cc2706b9796f227ea6977 (diff)
downloadpardes-989a3120542c0a07831c2496d74bad1fc8e75cba.tar.gz
pardes-989a3120542c0a07831c2496d74bad1fc8e75cba.zip
test: review of the fsa port: cutWrites' no-newline check and runFile's pty/ctl rows word fail with an error, not a panic (a panic in a case ends the runner before Detached.deinit, leaving its pardes --detach running and its /tmp/pardes-process-* root behind, as a break of the closed-line run showed); the port checked against nine breaks of the reviewer's own, each failing its case at the assertion it names: a second ctl lock taken (tree's lock refusal), pty/run's busy naming no program (terminals' busy), a last line with no newline dropped at the clunk (cut writes, now NeverRun), Putall stopping after its first save (Putall's refusal), Edit's w refusal over a file changed on disk not said (edit's w), Store.reopen refusing every closed pane (the store's @p), a directory pane's get not reading it again (T1 directory pane), a sel write leaving dot empty after it (tree's sel), X's file match inverted (edit's X)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/process')
-rw-r--r--test/process/terminals.zig2
-rw-r--r--test/process/tree.zig3
2 files changed, 3 insertions, 2 deletions
diff --git a/test/process/terminals.zig b/test/process/terminals.zig
index e84b48e9..1c73e941 100644
--- a/test/process/terminals.zig
+++ b/test/process/terminals.zig
@@ -155,7 +155,7 @@ fn runFile(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
var words = std.mem.tokenizeAny(u8, try c.read(a, ptyctl), " \n");
_ = words.next();
_ = words.next();
- try expectEqualStrings("2", words.next().?);
+ try expectEqualStrings("2", words.next() orelse ""); // not `.?`: a panic leaves the session running
try c.write(ptyctl, "winsize 80 24\n");
// A shell started again that cannot start (its directory is there but
// cannot be entered) fails the write and leaves the running shell be:
diff --git a/test/process/tree.zig b/test/process/tree.zig
index 4d1b2915..5139c716 100644
--- a/test/process/tree.zig
+++ b/test/process/tree.zig
@@ -462,7 +462,8 @@ fn cutWrites(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try expect(!has(log, "\nrun ") and !has(log, "exit 127"));
try c.write("/exec", "Msg no-newline-at-end");
const said = try c.read(a, "/log");
- const upto = said[0..std.mem.indexOf(u8, said, "no-newline-at-end").?];
+ // An error, not `.?`: a panic would leave the session running.
+ const upto = said[0 .. std.mem.indexOf(u8, said, "no-newline-at-end") orelse return error.NeverRun];
try expect(has(upto[upto.len -| 40..], "msg "));
const serial = try c.newPane();
var block: std.ArrayList(u8) = .empty;