summaryrefslogtreecommitdiff
path: root/test/behaviour
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour')
-rw-r--r--test/behaviour/other_files.zig7
-rw-r--r--test/behaviour/panes.zig13
2 files changed, 19 insertions, 1 deletions
diff --git a/test/behaviour/other_files.zig b/test/behaviour/other_files.zig
index b97affc4..c0f9c08f 100644
--- a/test/behaviour/other_files.zig
+++ b/test/behaviour/other_files.zig
@@ -21,3 +21,10 @@ test "other-files: kbdin types at the pane with the keyboard and mousein clicks,
try std.testing.expectEqual(@as(u16, 22), try s.refused("/kbdin", "\xff"));
try std.testing.expectError(error.Refused, s.read("/kbdin"));
}
+
+test "other-files: kbdin's Kalt rune is Alt on the key after it alone, and an Alt key types nothing" {
+ var s = try Session.initFile(std.testing.allocator, "x\n");
+ defer s.deinit();
+ try s.keys("i\u{F015}zy\x1b");
+ try s.expect(s.at("/pane/{d}/body", .{try s.focused()}), "yx\n");
+}
diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig
index 45b7152c..01820a07 100644
--- a/test/behaviour/panes.zig
+++ b/test/behaviour/panes.zig
@@ -8,7 +8,18 @@ test "panes: a collapsed pane's ctl says so" {
const first = try s.focused();
_ = try s.newPane();
try s.write(s.at("/pane/{d}/ctl", .{first}), "Collapse\n");
- try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " collapsed "));
+ try std.testing.expect(std.mem.indexOf(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " collapsed ") != null);
+}
+
+test "panes: a pane's ctl read ends with its mode, as its tag's box shows it" {
+ var s = try Session.initFile(std.testing.allocator, "x\n");
+ defer s.deinit();
+ const ctl = s.at("/pane/{d}/ctl", .{try s.focused()});
+ try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:normal "));
+ try s.keys("i");
+ try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:insert "));
+ try s.keys("\x1bv");
+ try std.testing.expect(std.mem.endsWith(u8, try s.read(ctl), " mode:select "));
}
test "panes: the ctl word name refuses a leading blank, as the name file does" {