diff options
Diffstat (limited to 'core/tape.zig')
| -rw-r--r-- | core/tape.zig | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/core/tape.zig b/core/tape.zig index f231831d..5056f225 100644 --- a/core/tape.zig +++ b/core/tape.zig @@ -1153,7 +1153,8 @@ fn tagOf(comptime entry: anytype, comptime Made: type) [:0]const u8 { /// The entries that answer stop by nature: the answer is the session's. const keeps_stopping = [_]Host.Fn{ // A shell's input: a device by the user's line (a far shell may feel - // like ssh), and off the tape with screen-state terminals. + // like ssh; core/echo.zig predicts its echo), and off the tape outside + // a speculation. .pty_write, // Its host says into the core on every call that the shell started // and where (host_io.forkShell: acknowledgeShell, setCwd), and gives @@ -1197,8 +1198,10 @@ fn hostCall(t: *Tape, p: *const Pardes, comptime f: Host.Fn, args: Host.Args(f)) const R = Host.Ret(f); const name = @tagName(f); // A terminal's answers and what is typed at it from its output are the - // authority's to write, never a replica's: off the tape on both sides. - if (comptime std.mem.eql(u8, name, "pty_write")) if (t.screen_state and !t.speculating) { + // authority's to write, never a replica's: off the tape on both sides + // (a replica's replay of the step writes nothing, and checks nothing: + // a write returns nothing a step reads). + if (comptime std.mem.eql(u8, name, "pty_write")) if (!t.speculating) { if (!t.replay) _ = p.host.call(f, args); return; }; @@ -1832,11 +1835,11 @@ test "a core pumped twice with one host and once with another: which functions i const R = pardes.replica; var first: Pumped = .{ .ns = 0 }; var second: Pumped = .{ .ns = 1 << 40 }; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24 }, .{ .ctx = &first, .vtable = &Pumped.one }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24 }, .{ .ctx = &first, .vtable = &Pumped.one }); defer a.deinit(); const boot = Pumped.said(a.t.buf.items); try std.testing.expectEqual(Host.mask(.{ .vtable = &Pumped.one }), boot.mask); - const r = try R.Replica.init(gpa, 1, try a.unit(0, 0), false); + const r = try R.Replica.init(gpa, 1, try a.unit(0, 0)); defer r.deinit(); const hosts = [_]Host{ .{ .ctx = &first, .vtable = &Pumped.one }, .{ .ctx = &second, .vtable = &Pumped.more } }; for (hosts, [_]usize{ 0, 1 }, 1..) |h, sets, seq| { |
