From 9856303ef6b904fb97dd53ce114b7a2ead099f12 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 9 Dec 2024 16:03:31 +0100 Subject: [PATCH] fix: keybind unittests --- src/keybind/keybind.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/keybind/keybind.zig b/src/keybind/keybind.zig index 84ccaa3..9779e17 100644 --- a/src/keybind/keybind.zig +++ b/src/keybind/keybind.zig @@ -728,17 +728,17 @@ test "match" { const events = try parse_vim.parse_key_events(alloc, input.event.press, case[0]); defer alloc.free(events); const binding: Binding = .{ - .keys = try parse_vim.parse_key_events(alloc, input.event.press, case[1]), - .command = .{}, + .key_events = try parse_vim.parse_key_events(alloc, input.event.press, case[1]), + .commands = &[_]Command{}, }; - defer alloc.free(binding.keys); + defer alloc.free(binding.key_events); try expectEqual(case[2], binding.match(events)); } } test "json" { - var bindings: BindingSet = .{}; + var bindings: BindingSet = .{ .name = "test" }; _ = try bindings.process_key_event('j', .{ .key = 'j' }); _ = try bindings.process_key_event('k', .{ .key = 'k' }); _ = try bindings.process_key_event('g', .{ .key = 'g' });