aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/input/unit
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-04-17 15:21:12 +0200
committerGitHub <noreply@github.com>2021-04-17 15:21:12 +0200
commitd5be5e3a849e5bb67c664c0dac35686a24fb6b13 (patch)
tree48f61f1329a5990b8ca021789e58fd16a981ba40 /src/common/input/unit
parentMerge branch 'main' of github.com:zellij-org/zellij (diff)
parentAdd Unbind for Keybindings (#241) (diff)
downloadsl0ppij-d5be5e3a849e5bb67c664c0dac35686a24fb6b13.tar.gz
sl0ppij-d5be5e3a849e5bb67c664c0dac35686a24fb6b13.tar.xz
sl0ppij-d5be5e3a849e5bb67c664c0dac35686a24fb6b13.zip
Merge pull request #275 from a-kenji/unbind-default-keys
Unbind default keys
Diffstat (limited to 'src/common/input/unit')
-rw-r--r--src/common/input/unit/keybinds_test.rs31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/common/input/unit/keybinds_test.rs b/src/common/input/unit/keybinds_test.rs
index 6411d017..e0d78b62 100644
--- a/src/common/input/unit/keybinds_test.rs
+++ b/src/common/input/unit/keybinds_test.rs
@@ -124,12 +124,25 @@ fn from_keyaction_from_yaml_to_mode_keybindings() {
assert_eq!(expected, ModeKeybinds::from(keyaction));
}
-//#[test]
-//fn from_keybinds_from_yaml_to_keybinds(){
-//let mut keybinds_from_yaml = KeybindsFromYaml(HashMap<InputMode, Vec<KeyActionFromYaml>>);
-//let actions = vec![Action::NoOp, Action::GoToTab(1), ];
-//let keyaction = KeyActionFromYaml {
-//action : actions.clone(),
-//key : vec![ Key::F(1), Key::Backspace , Key::Char('t'), ],
-//};
-//}
+#[test]
+fn toplevel_unbind_unbinds_all() {
+ let from_yaml = KeybindsFromYaml {
+ unbind: Unbind::All(true),
+ keybinds: HashMap::new(),
+ };
+
+ let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml));
+
+ assert_eq!(keybinds_from_yaml, Keybinds::new());
+}
+
+fn no_unbind_unbinds_none() {
+ let from_yaml = KeybindsFromYaml {
+ unbind: Unbind::All(false),
+ keybinds: HashMap::new(),
+ };
+
+ let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml));
+
+ assert_eq!(keybinds_from_yaml, Keybinds::new());
+}