Unnamed repository; edit this file 'description' to name the repository.
simplify some keymap key names follow up tests (#2694)
Henry 2022-06-17
parent 33ea3ef · commit 15807d5
-rw-r--r--helix-view/src/input.rs42
1 files changed, 41 insertions, 1 deletions
diff --git a/helix-view/src/input.rs b/helix-view/src/input.rs
index b4875d49..5b867930 100644
--- a/helix-view/src/input.rs
+++ b/helix-view/src/input.rs
@@ -323,7 +323,39 @@ mod test {
code: KeyCode::Char('%'),
modifiers: KeyModifiers::NONE
}
- )
+ );
+
+ assert_eq!(
+ str::parse::<KeyEvent>(";").unwrap(),
+ KeyEvent {
+ code: KeyCode::Char(';'),
+ modifiers: KeyModifiers::NONE
+ }
+ );
+
+ assert_eq!(
+ str::parse::<KeyEvent>(">").unwrap(),
+ KeyEvent {
+ code: KeyCode::Char('>'),
+ modifiers: KeyModifiers::NONE
+ }
+ );
+
+ assert_eq!(
+ str::parse::<KeyEvent>("<").unwrap(),
+ KeyEvent {
+ code: KeyCode::Char('<'),
+ modifiers: KeyModifiers::NONE
+ }
+ );
+
+ assert_eq!(
+ str::parse::<KeyEvent>("+").unwrap(),
+ KeyEvent {
+ code: KeyCode::Char('+'),
+ modifiers: KeyModifiers::NONE
+ }
+ );
}
#[test]
@@ -351,6 +383,14 @@ mod test {
modifiers: KeyModifiers::SHIFT | KeyModifiers::CONTROL
}
);
+
+ assert_eq!(
+ str::parse::<KeyEvent>("A-C-+").unwrap(),
+ KeyEvent {
+ code: KeyCode::Char('+'),
+ modifiers: KeyModifiers::ALT | KeyModifiers::CONTROL
+ }
+ );
}
#[test]