summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/behaviour/builtins.zig1
-rw-r--r--test/behaviour/columns_and_tags.zig2
-rw-r--r--test/behaviour/keys.zig5
-rw-r--r--test/behaviour/modes.zig8
4 files changed, 12 insertions, 4 deletions
diff --git a/test/behaviour/builtins.zig b/test/behaviour/builtins.zig
index 6f029072..3c16a4a2 100644
--- a/test/behaviour/builtins.zig
+++ b/test/behaviour/builtins.zig
@@ -31,5 +31,6 @@ test "builtins: Mini maps a file of the pane's directory over pardes's own sourc
try s.expect("/index", index);
// Save asks for a path; nothing is written for it.
try s.write(s.at("/pane/{d}/exec", .{mini}), "Save\n");
+ try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), s.at("ask {d} save path\n", .{mini})) != null);
try std.testing.expectEqual(@as(usize, 0), s.saved);
}
diff --git a/test/behaviour/columns_and_tags.zig b/test/behaviour/columns_and_tags.zig
index ac8e7034..c1935bf8 100644
--- a/test/behaviour/columns_and_tags.zig
+++ b/test/behaviour/columns_and_tags.zig
@@ -285,6 +285,8 @@ test "columns-and-tags: a column tag lights the word under the mouse, is clicked
try std.testing.expect(std.mem.indexOf(u8, try s.screen(), s.at("{s}b", .{row[1..]})) != null);
try s.keys("\u{F00D}");
try std.testing.expectEqual(x, (try s.cursor()).?[0]);
+ // Scrolled back: the text drawn whole from its first cell again.
+ try std.testing.expect(std.mem.indexOf(u8, try s.screen(), s.at("{s}b", .{row})) != null);
try s.keys("\x1b\x1b");
try s.write("/mousein", "m 0 23 0\n");
}
diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig
index b6fe1e83..aa1128a3 100644
--- a/test/behaviour/keys.zig
+++ b/test/behaviour/keys.zig
@@ -226,7 +226,8 @@ test "keys: SPC j n and SPC j p walk Themes' rows, whole, never its section head
try std.testing.expectEqualStrings(names.items[brk - 1]["Theme ".len..], try setting(&s, "Theme"));
}
-test "keys: SPC j n in a command output selects its whole row, Tab runs it, and from where a Look took the keyboard it walks on there" {
+// Its rows whole and Tab running one are the Themes walk's test above.
+test "keys: SPC j n from the pane a Look gave the keyboard walks back into the command output" {
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();
for ([_][]const u8{ "a.txt", "b.txt" }) |name| try tmp.dir.writeFile(std.testing.io, .{ .sub_path = name, .data = "x\n" });
@@ -242,8 +243,6 @@ test "keys: SPC j n in a command output selects its whole row, Tab runs it, and
try std.testing.expect(themes != a);
const sel = s.at("/pane/{d}/sel", .{themes});
try s.expect(sel, "Theme orchard");
- try s.keys(" jn\t");
- try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nTheme dusk\n") != null);
try s.write(s.at("/pane/{d}/exec", .{a}), "Look b.txt\n");
try std.testing.expect(try s.focused() != themes);
try s.keys(" jn");
diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig
index b1641c6f..6e07e1b4 100644
--- a/test/behaviour/modes.zig
+++ b/test/behaviour/modes.zig
@@ -204,7 +204,9 @@ test "modes: in window mode d deletes the outlined pane, asking k or j between t
try expectEqual(row_low, (try s.where("/low Save"))[1]);
// d between two panes asks, as SPC d does; Esc takes it back, the
// outline where it was.
- try s.keys("d\x1b");
+ try s.keys("d");
+ try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), s.at("ask {d} del k j\n", .{mid})) != null);
+ try s.keys("\x1b");
try std.testing.expect(try listed(&s, mid));
try std.testing.expectEqualStrings("/mid", try outlined(&s, lit, names));
// j: the pane below takes the rows, and the outline goes with them.
@@ -217,6 +219,7 @@ test "modes: in window mode d deletes the outlined pane, asking k or j between t
// pane that grew.
try s.keys("d");
try std.testing.expect(!try listed(&s, low));
+ try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), s.at("ask {d} ", .{low})) == null);
try std.testing.expectEqualStrings("/test.txt", try outlined(&s, lit, &.{"/test.txt"}));
// Enter leaves the mode on it.
try s.keys("\n");
@@ -238,7 +241,10 @@ test "modes: window keys walk from a pane up through its column's tag and the wo
const x0, const y0 = (try s.cursor()).?;
try expectEqual(@as(usize, 1), y0);
try std.testing.expect(x0 < right);
+ const tag = s.at("/col/{d}/tag", .{try s.column(0)});
+ const words = try s.read(tag);
try s.keys("w");
+ try s.expect(tag, words);
const remembered = (try s.cursor()).?;
try std.testing.expect(remembered[0] > x0);
// Across to the right column's tag, and back to where the caret was.