summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 07:10:49 -0300
committerGabriel Schneider <[email protected]>2026-11-20 08:11:39 -0300
commitd1db265b934db24268bbb2da780927fc1a2065f9 (patch)
treed15cdb77e5fd3998dd8c4e5049ea2f113740db98
parent2c2800c93e5417297dd06d3e52d5d336d975560c (diff)
downloadpardes-d1db265b934db24268bbb2da780927fc1a2065f9.tar.gz
pardes-d1db265b934db24268bbb2da780927fc1a2065f9.zip
test: terminals' drive starts its session with Verbose off, so Term's announcement (the builtin's name on its pane's message row, kept MessageLinger's 800 ms in a session no frontend dismisses) is no longer on the screen `before` is taken from and gone by the time ^U's answer is compared with it (process-test 'a control byte through pty/data ...' failed in each of merge31, 32 and 33's whole runs, and 'what a program prints past a screenful' once in 3 runs of the file: the screens differed in that one word, `Term` at the right of agent.txt's first row; a run fast enough to take `before` inside the 800 ms fails, a loaded one does not: 0 of 150 alone at a load of 35-43; with the linger 5000 and 5 s before ^U, 4 of 4 drive cases failed so, with Verbose off 0 of 9), and the screens printed when they differ; the case 0 of 3 in whole runs at a load of 32-40
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
-rw-r--r--test/process/terminals.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/process/terminals.zig b/test/process/terminals.zig
index 24772ced..d9c3bcca 100644
--- a/test/process/terminals.zig
+++ b/test/process/terminals.zig
@@ -262,7 +262,9 @@ fn rawKey(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
/// thousand: nothing printed is nothing kept), then a probe typed and
/// taken back with ^U.
fn drive(gpa: std.mem.Allocator, exe: [:0]const u8, script: []const u8, key: ?u8, rows: usize) !void {
- var d = try process.Detached.start(gpa, exe, "agent", .{});
+ // No builtin announces itself: Term's name would linger on the screen
+ // (MessageLinger, 800 ms) and go between `before` and ^U's answer.
+ var d = try process.Detached.start(gpa, exe, "agent", .{ .init = "Verbose off\n" });
defer d.deinit();
const f = &d.files;
try d.put("command.sh", f.at("exec /bin/sh -c '{s}'\n", .{script}));
@@ -300,7 +302,10 @@ fn drive(gpa: std.mem.Allocator, exe: [:0]const u8, script: []const u8, key: ?u8
try f.write(data, "\x15");
const back_by = eh.nowMs() + 10_000;
while (!std.mem.eql(u8, try f.screen(), before)) {
- if (eh.nowMs() > back_by) return error.ScreenNotRestored;
+ if (eh.nowMs() > back_by) {
+ std.debug.print("before:\n{s}\nafter ^U:\n{s}\n", .{ before, try f.screen() });
+ return error.ScreenNotRestored;
+ }
sleepMs(10);
}
}