summaryrefslogtreecommitdiff
path: root/test/process/tree.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/process/tree.zig')
-rw-r--r--test/process/tree.zig3
1 files changed, 2 insertions, 1 deletions
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;