fix: keybind unittests
This commit is contained in:
parent
5e35824a22
commit
9856303ef6
1 changed files with 4 additions and 4 deletions
|
@ -728,17 +728,17 @@ test "match" {
|
||||||
const events = try parse_vim.parse_key_events(alloc, input.event.press, case[0]);
|
const events = try parse_vim.parse_key_events(alloc, input.event.press, case[0]);
|
||||||
defer alloc.free(events);
|
defer alloc.free(events);
|
||||||
const binding: Binding = .{
|
const binding: Binding = .{
|
||||||
.keys = try parse_vim.parse_key_events(alloc, input.event.press, case[1]),
|
.key_events = try parse_vim.parse_key_events(alloc, input.event.press, case[1]),
|
||||||
.command = .{},
|
.commands = &[_]Command{},
|
||||||
};
|
};
|
||||||
defer alloc.free(binding.keys);
|
defer alloc.free(binding.key_events);
|
||||||
|
|
||||||
try expectEqual(case[2], binding.match(events));
|
try expectEqual(case[2], binding.match(events));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test "json" {
|
test "json" {
|
||||||
var bindings: BindingSet = .{};
|
var bindings: BindingSet = .{ .name = "test" };
|
||||||
_ = try bindings.process_key_event('j', .{ .key = 'j' });
|
_ = try bindings.process_key_event('j', .{ .key = 'j' });
|
||||||
_ = try bindings.process_key_event('k', .{ .key = 'k' });
|
_ = try bindings.process_key_event('k', .{ .key = 'k' });
|
||||||
_ = try bindings.process_key_event('g', .{ .key = 'g' });
|
_ = try bindings.process_key_event('g', .{ .key = 'g' });
|
||||||
|
|
Loading…
Add table
Reference in a new issue