summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 4e578791..1659a94b 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -1717,20 +1717,20 @@ test "a REPL bound for a language takes the exec made on a body in it; tags, Exe
try std.testing.expect(p.executeBuiltinLine(2, "Repl python"));
try std.testing.expectEqualStrings("python-b", exec.replId(&idbuf, p.panes[2].?));
- // Two bound always ask, whichever has a program running: one left
- // (Ctrl-D: the shell has the tty) is still offered, and chosen, it is
- // sent nothing, nothing runs, and that is said.
+ // A bound REPL whose program exited (Ctrl-D: the shell has the tty) is
+ // skipped: the one still running takes the text, no question asked;
+ // with none running, nothing runs and that is said.
host.taken[1] = false;
_ = exec.executeFrom(p, 0, "import os", true);
- try std.testing.expectEqual(Pane.Prompt.repl_choice, file.prompt);
- p.update(.{ .key = .{ .cp = 'a' } });
+ try std.testing.expectEqual(Pane.Prompt.none, file.prompt);
Sent.drain(p);
- try std.testing.expect(Sent.len[1] == 0 and Sent.len[2] == 0 and !Sent.spawned);
- try std.testing.expect(std.mem.indexOf(u8, file.msg[0..file.msg_len], "no program running") != null);
+ try std.testing.expectEqualStrings("import os\r", Sent.said(2));
host.taken[2] = false;
_ = exec.executeFrom(p, 0, "import os", true);
- try std.testing.expectEqual(Pane.Prompt.repl_choice, file.prompt);
- p.update(.{ .key = .{ .cp = Key.escape } });
+ try std.testing.expectEqual(Pane.Prompt.none, file.prompt);
+ Sent.drain(p);
+ try std.testing.expect(Sent.len[1] == 0 and Sent.len[2] == 0 and !Sent.spawned);
+ try std.testing.expect(std.mem.indexOf(u8, file.msg[0..file.msg_len], "no program running") != null);
host.taken[1] = true;
host.taken[2] = true;