diff options
Diffstat (limited to 'src/replica.zig')
| -rw-r--r-- | src/replica.zig | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/replica.zig b/src/replica.zig index 0b22f8b2..dd6f34bc 100644 --- a/src/replica.zig +++ b/src/replica.zig @@ -4383,3 +4383,26 @@ test "a replica's word that opens a kind's pane with no file waits for the autho try agrees(a, r); try std.testing.expect(r.core().panes[r.core().view().active].?.addon != null); } + +test "a client joined from a dump tells a kind each view's facts as the session does, the live one's and another's" { + const gpa = std.testing.allocator; + const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, TestHost.host(), false); + defer a.deinit(); + var words: [64]pardes.Kind.LoadedWord = undefined; + const placed = pardes.Kind.loadedOf(&Placed.ops, "/x/placed.so", @splat(7), &words); + _ = try a.local(.{ .addon = .{ .op = .load, .pane = 0, .kind = &placed } }); + _ = try a.local(.{ .command = "Placed" }); + // A message in its pane: a band over its body, in each view. + _ = try a.local(.{ .command = "Placed x" }); + // The second client's view laid out by an input of its own, then the + // first's resized: its kind told at the session's next step of its own. + _ = try a.openView(2); + var buf: [256]u8 = undefined; + _ = try a.take(try inputOf(&buf, 2, 1, .{ .resize = .{ .cols = 80, .rows = 24 } })); + _ = try a.take(try inputOf(&buf, 1, 1, .{ .resize = .{ .cols = 80, .rows = 20 } })); + const joiner = try joinedNow(a, 3, 1); + defer joiner.deinit(); + try std.testing.expectEqual(digestOf(a), joiner.digest()); + joiner.confirm(try a.local(.tick)); + try agrees(a, joiner); +} |
