fix: tests after merging master

pull/3958/head
Vulpesx 6 months ago committed by Matthew Cheely
parent e652d01e0c
commit 029f7b4414

@ -177,7 +177,6 @@ mod tests {
#[test] #[test]
fn parsing_menus() { fn parsing_menus() {
use crate::keymap; use crate::keymap;
use crate::keymap::Keymap;
use helix_core::hashmap; use helix_core::hashmap;
use helix_view::document::Mode; use helix_view::document::Mode;
@ -191,7 +190,7 @@ mod tests {
merge_keys( merge_keys(
&mut keys, &mut keys,
hashmap! { hashmap! {
Mode::Normal => Keymap::new(keymap!({ "Normal mode" Mode::Normal => keymap!({ "Normal mode"
"f" => { "" "f" => { ""
"f" => file_picker, "f" => file_picker,
"c" => wclose, "c" => wclose,
@ -200,7 +199,7 @@ mod tests {
"b" => buffer_picker, "b" => buffer_picker,
"n" => goto_next_buffer, "n" => goto_next_buffer,
}, },
})), }),
}, },
); );
@ -229,19 +228,23 @@ mod tests {
let config = Config::load_test(sample_keymaps); let config = Config::load_test(sample_keymaps);
let tree = config.keys.get(&Mode::Normal).unwrap().root(); let tree = config.keys.get(&Mode::Normal).unwrap();
if let keymap::KeyTrie::Node(node) = tree { if let keymap::KeyTrie::Node(node) = tree {
let open_node = node.get(&KeyEvent::from_str("o").unwrap()).unwrap(); let open_node = node.get(&KeyEvent::from_str("o").unwrap()).unwrap();
if let keymap::KeyTrie::Leaf(MappableCommand::Typable { doc, .. }) = open_node { if let keymap::KeyTrie::MappableCommand(MappableCommand::Typable { doc, .. }) =
open_node
{
assert_eq!(doc, "Edit Config"); assert_eq!(doc, "Edit Config");
} else { } else {
panic!("Edit Config did not parse to typable command"); panic!("Edit Config did not parse to typable command");
} }
let close_node = node.get(&KeyEvent::from_str("c").unwrap()).unwrap(); let close_node = node.get(&KeyEvent::from_str("c").unwrap()).unwrap();
if let keymap::KeyTrie::Leaf(MappableCommand::Typable { doc, .. }) = close_node { if let keymap::KeyTrie::MappableCommand(MappableCommand::Typable { doc, .. }) =
close_node
{
assert_eq!(doc, ":buffer-close []"); assert_eq!(doc, ":buffer-close []");
} else { } else {
panic!(":buffer-close command did not parse to typable command"); panic!(":buffer-close command did not parse to typable command");

Loading…
Cancel
Save