diff options
Diffstat (limited to 'src/ninep/cols.zig')
| -rw-r--r-- | src/ninep/cols.zig | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig index 0ee25345..833b25c5 100644 --- a/src/ninep/cols.zig +++ b/src/ninep/cols.zig @@ -564,23 +564,20 @@ test "a column's tag and the workspace's read, replace and append as a pane tag } test "a focus write makes its pane's column the active one: layout says so and pane/new goes there" { - for ([_][]const u8{ "Placement acme", "Placement pardes" }) |placement| { - const p = try th.withFile(testing.allocator, "x\n"); - defer p.deinit(); - try testing.expect(p.executeBuiltinLine(p.active, placement)); - const left = p.panes[0].?.serial; - p.newColumn(p.active); - p.newScratchFor(p.active, .fs); // fills the new, right column - p.sync(); - try testing.expectEqual(@as(usize, 1), layout.findPane(p, p.active).?.col); - var digits: [16]u8 = undefined; - _ = th.wr(p, @backingInt(tree.TopFile.focus), try std.fmt.bufPrint(&digits, "{d}\n", .{left})); - var want: [32]u8 = undefined; - const text = th.rd(p, @backingInt(tree.TopFile.layout), 0, 4096).bytes; - try testing.expect(std.mem.endsWith(u8, text, try std.fmt.bufPrint(&want, "active {d}\n", .{layout.columnSerial(p, 0)}))); - const made = th.call(p, .{ .tag = 1, .op = .open, .node = @backingInt(tree.TopFile.new) }).reply.handle; - try testing.expectEqual(@as(usize, 0), layout.findPane(p, p.paneBySerial(made).?).?.col); - } + const p = try th.withFile(testing.allocator, "x\n"); + defer p.deinit(); + const left = p.panes[0].?.serial; + p.newColumn(p.active); + p.newScratchFor(p.active, .fs); // fills the new, right column + p.sync(); + try testing.expectEqual(@as(usize, 1), layout.findPane(p, p.active).?.col); + var digits: [16]u8 = undefined; + _ = th.wr(p, @backingInt(tree.TopFile.focus), try std.fmt.bufPrint(&digits, "{d}\n", .{left})); + var want: [32]u8 = undefined; + const text = th.rd(p, @backingInt(tree.TopFile.layout), 0, 4096).bytes; + try testing.expect(std.mem.endsWith(u8, text, try std.fmt.bufPrint(&want, "active {d}\n", .{layout.columnSerial(p, 0)}))); + const made = th.call(p, .{ .tag = 1, .op = .open, .node = @backingInt(tree.TopFile.new) }).reply.handle; + try testing.expectEqual(@as(usize, 0), layout.findPane(p, p.paneBySerial(made).?).?.col); } test "a refused write after a truncation leaves every kind of tag as it was, and Dump still works" { |
