summaryrefslogtreecommitdiff
path: root/test/process/look_and_exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/process/look_and_exec.zig')
-rw-r--r--test/process/look_and_exec.zig14
1 files changed, 2 insertions, 12 deletions
diff --git a/test/process/look_and_exec.zig b/test/process/look_and_exec.zig
index 9829797b..8ba52534 100644
--- a/test/process/look_and_exec.zig
+++ b/test/process/look_and_exec.zig
@@ -118,18 +118,8 @@ fn canary(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
// A terminal: pty/run failing then passing.
const term = try f.madeBy(1, "Term\n");
- {
- const deadline = process.nowMs() + 10_000;
- while (true) {
- const answer = try f.run(term, "true\n");
- if (std.mem.eql(u8, answer, "exit 0\n")) break;
- if (process.nowMs() > deadline) {
- std.debug.print("pty/run answered {s}\n", .{answer});
- return error.Timeout;
- }
- process.nap(50);
- }
- }
+ // Asked at once: a run waits for its first prompt and its greeting.
+ try std.testing.expectEqualStrings("exit 0\n", try f.run(term, "true\n"));
try std.testing.expectEqualStrings("exit 1\n", try f.run(term, "false\n"));
try std.testing.expectEqualStrings("exit 0\npassed\n", try f.run(term, "echo passed\n"));
// (A run's answer is its record: the log has no err for these.)