summaryrefslogtreecommitdiff
path: root/test/process
diff options
context:
space:
mode:
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;