summaryrefslogtreecommitdiff
path: root/test/behaviour
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour')
-rw-r--r--test/behaviour/keys.zig24
-rw-r--r--test/behaviour/look_and_exec.zig27
-rw-r--r--test/behaviour/modes.zig4
-rw-r--r--test/behaviour/panes.zig1
-rw-r--r--test/behaviour/placement.zig18
-rw-r--r--test/behaviour/root_ctl.zig1
6 files changed, 2 insertions, 73 deletions
diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig
index 476504ce..eeaacf7d 100644
--- a/test/behaviour/keys.zig
+++ b/test/behaviour/keys.zig
@@ -323,30 +323,6 @@ test "keys: SPC j n from the pane a Look gave the keyboard walks back into the c
try std.testing.expect(std.mem.startsWith(u8, try s.read(sel), "Theme "));
}
-test "keys: SPC j n and SPC j p walk on from the place a Look's +Search listing chose, its keyboard left in the file" {
- var tmp = std.testing.tmpDir(.{});
- defer tmp.cleanup();
- try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "look-owner.txt", .data = "alpha target\nbeta target\ngamma target\n" });
- var dir: [4096]u8 = undefined;
- const at = dir[0..try tmp.dir.realPath(std.testing.io, &dir)];
- var s = try Session.initFile(std.testing.allocator, "x\n");
- defer s.deinit();
- try s.write("/ctl", "LookWord list\n"); // the +Search listing is what is walked
- try s.write("/look", s.at("{s}/look-owner.txt\n", .{at}));
- const file = try s.focused();
- try s.write(s.at("/pane/{d}/exec", .{file}), "Look target\n");
- try std.testing.expectEqual(file, try s.focused());
- // The Look took the first; the walk goes on from it, and back.
- try s.keys(" jn");
- const results = try s.focused();
- try std.testing.expect(results != file);
- const sel = s.at("/pane/{d}/sel", .{results});
- try s.expect(sel, "look-owner.txt:2:6-11");
- try s.keys(" jp");
- try std.testing.expectEqual(results, try s.focused());
- try s.expect(sel, "look-owner.txt:1:7-12");
-}
-
/// Screen row `row` as drawn.
fn screenRow(s: *Session, row: usize) ![]const u8 {
var rows = std.mem.splitScalar(u8, try s.screen(), '\n');
diff --git a/test/behaviour/look_and_exec.zig b/test/behaviour/look_and_exec.zig
index ee9554cc..e88a0053 100644
--- a/test/behaviour/look_and_exec.zig
+++ b/test/behaviour/look_and_exec.zig
@@ -593,7 +593,7 @@ test "look-and-exec: a look that goes to another pane leaves the looking pane's
}
}
-test "look-and-exec: a looked word is found in its own pane, next place after the dot, wrapping, and opens no pane; LookWord list lists it in +Search" {
+test "look-and-exec: a looked word is found in its own pane, next place after the dot, wrapping, and opens no pane" {
var s = try Session.initFile(std.testing.allocator, "foo x foo y\n");
defer s.deinit();
const n = try s.focused();
@@ -604,31 +604,6 @@ test "look-and-exec: a looked word is found in its own pane, next place after th
try expectEqual(.{ at, at + 3 }, try s.range(s.at("/pane/{d}/dot", .{n})));
}
try s.expect("/index", index);
- try s.write("/ctl", "LookWord list\n");
- try s.write(look, "foo\n");
- try std.testing.expect(lines(try s.read("/index")) > lines(index));
- // ...and look reads back that +Search pane, where the places are.
- const search = try paneNamed(&s, "/+Search");
- try std.testing.expect(has(try s.read(look), s.at("{d}\n", .{search})));
-}
-
-test "look-and-exec: a second LookWord list look in a directory refills its +Search rather than stacking another" {
- var tmp = std.testing.tmpDir(.{});
- defer tmp.cleanup();
- try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "words.txt", .data = "alpha beta\nalpha beta\n" });
- var s = try Session.initFile(std.testing.allocator, "x\n");
- defer s.deinit();
- const n = try s.focused();
- try s.write(s.at("/pane/{d}/name", .{n}), s.at("{s}/words.txt\n", .{try tmpPath(&s, &tmp)}));
- try s.write(s.at("/pane/{d}/exec", .{n}), "Get\n");
- try s.write("/ctl", "LookWord list\n");
- try s.write(s.at("/pane/{d}/look", .{n}), "alpha\n");
- const first = try paneNamed(&s, "/+Search");
- try s.write(s.at("/pane/{d}/look", .{n}), "beta\n");
- try expectEqual(@as(usize, 1), std.mem.count(u8, try s.read("/index"), "/+Search "));
- try expectEqual(first, try paneNamed(&s, "/+Search"));
- // Refilled with beta's places (columns 7-10), not alpha's.
- try std.testing.expect(has(try s.read(s.at("/pane/{d}/body", .{first})), "words.txt:1:7-10\n"));
}
test "look-and-exec: `@pN:` looks at pane N as `a.txt:` looks at a.txt, and a line past the end is said one way, `:N` or `file:N`" {
diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig
index 961ca788..ef39d912 100644
--- a/test/behaviour/modes.zig
+++ b/test/behaviour/modes.zig
@@ -174,8 +174,6 @@ fn listed(s: *Session, n: u32) !bool {
test "modes: in window mode d deletes the outlined pane, asking k or j between two, c collapses it, and the mode stays on" {
var s = try Session.initFile(std.testing.allocator, "top\n");
defer s.deinit();
- // The neighbours below are what is under test: each New right under its asker.
- try s.write("/ctl", "Placement pardes\n");
const top = try s.focused();
try s.write(s.at("/pane/{d}/exec", .{top}), "New\n");
const mid = try s.focused();
@@ -451,8 +449,6 @@ test "modes: Ctrl-o and Ctrl-i drop the selections, select mode and the extra cu
test "modes: hopping between two panes by Esc, window mode or a click makes no places, so one Ctrl-o goes back across and the next has nowhere to go" {
var s = try Session.initFile(std.testing.allocator, std.mem.asBytes(&@as([100][4]u8, @splat("row\n".*))));
defer s.deinit();
- // Two panes of room, not acme's fit to the doc.
- try s.write("/ctl", "Placement pardes\n");
const doc = try s.focused();
try s.keys("\u{F015}n"); // a shell under the doc
const shell = try s.focused();
diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig
index 0c0edbf9..12be354a 100644
--- a/test/behaviour/panes.zig
+++ b/test/behaviour/panes.zig
@@ -182,7 +182,6 @@ test "panes: an unsaved file's tag is its name alone, its dirty file says it is
test "panes: a pane closed while its question stands ends the question in the log" {
var s = try Session.initFile(std.testing.allocator, "x\n");
defer s.deinit();
- try s.write("/ctl", "Placement pardes\n");
const top = try s.focused();
try s.write(s.at("/pane/{d}/exec", .{top}), "New\n");
const closing = try s.focused();
diff --git a/test/behaviour/placement.zig b/test/behaviour/placement.zig
index 3d261808..73d69883 100644
--- a/test/behaviour/placement.zig
+++ b/test/behaviour/placement.zig
@@ -45,22 +45,7 @@ test "placement: New and 9P's new take the bottom half of the column's last pane
try std.testing.expect(try tagRow(&s, "/made") >= was + (rows - was) / 2);
}
-test "placement: Placement pardes puts a new pane right under the asking one, and bare it steps back to acme" {
- var s = try Session.initFile(std.testing.allocator, "x\n");
- defer s.deinit();
- try s.write("/ctl", "Placement pardes\n");
- try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPlacement pardes\n") != null);
- const top = try s.focused();
- try s.write(s.at("/pane/{d}/exec", .{top}), "New\n");
- const below = try s.focused();
- // Directly under the asking pane, as New always put it.
- try s.write(s.at("/pane/{d}/exec", .{top}), "New\n");
- try std.testing.expectEqualStrings(s.at("{d}:{d},{d},{d}", .{ try s.column(0), top, try s.focused(), below }), try s.columns());
- try s.write("/ctl", "Placement\n");
- try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPlacement acme\n") != null);
-}
-
-test "placement: a look under pardes's placement, from a pane pane/new made after Delcol, opens its file in a column" {
+test "placement: a look from a pane pane/new made after Delcol opens its file in a column" {
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "f.txt", .data = "file\n" });
@@ -69,7 +54,6 @@ test "placement: a look under pardes's placement, from a pane pane/new made afte
var s = try Session.initFile(std.testing.allocator, "x\n");
defer s.deinit();
const first = try s.focused();
- try s.write(s.at("/pane/{d}/exec", .{first}), "Placement\n");
try s.write(s.at("/pane/{d}/exec", .{first}), "Delcol\n");
const made = try s.newPane();
try s.write(s.at("/pane/{d}/look", .{made}), s.at("{s}/f.txt:#4\n", .{dir}));
diff --git a/test/behaviour/root_ctl.zig b/test/behaviour/root_ctl.zig
index 12f2b56a..7bf15ee2 100644
--- a/test/behaviour/root_ctl.zig
+++ b/test/behaviour/root_ctl.zig
@@ -62,7 +62,6 @@ test "root-ctl: the root ctl reads the settings as a write takes them, and takes
.{ "Del", "not a session control message \"Del\": write it to pane/<n>/ctl" },
.{ "Nonsense 1", "unknown control message \"Nonsense\"" },
.{ "Verbose maybe", "bad value in control message; takes on, off \"maybe\"" },
- .{ "Placement east", "bad value in control message; takes acme, pardes \"east\"" },
// A number's refusal names its range.
.{ "InactiveDim 200", "bad value in control message; takes 0-100 (a percentage) \"200\"" },
.{ "MessageLinger x", "bad value in control message; takes 0-60000 (milliseconds) \"x\"" },