From 15807d5f273012d048107487e3d9e13f3987878c Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 17 Jun 2022 10:51:45 -0400 Subject: [PATCH] simplify some keymap key names follow up tests (#2694) --- helix-view/src/input.rs | 42 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/helix-view/src/input.rs b/helix-view/src/input.rs index b4875d491..5b8679305 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::(";").unwrap(), + KeyEvent { + code: KeyCode::Char(';'), + modifiers: KeyModifiers::NONE + } + ); + + assert_eq!( + str::parse::(">").unwrap(), + KeyEvent { + code: KeyCode::Char('>'), + modifiers: KeyModifiers::NONE + } + ); + + assert_eq!( + str::parse::("<").unwrap(), + KeyEvent { + code: KeyCode::Char('<'), + modifiers: KeyModifiers::NONE + } + ); + + assert_eq!( + str::parse::("+").unwrap(), + KeyEvent { + code: KeyCode::Char('+'), + modifiers: KeyModifiers::NONE + } + ); } #[test] @@ -351,6 +383,14 @@ mod test { modifiers: KeyModifiers::SHIFT | KeyModifiers::CONTROL } ); + + assert_eq!( + str::parse::("A-C-+").unwrap(), + KeyEvent { + code: KeyCode::Char('+'), + modifiers: KeyModifiers::ALT | KeyModifiers::CONTROL + } + ); } #[test]