simplify some keymap key names follow up tests (#2694)

This commit is contained in:
Henry 2022-06-17 10:51:45 -04:00 committed by GitHub
parent 33ea3eff05
commit 15807d5f27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -323,7 +323,39 @@ fn parsing_unmodified_keys() {
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 @@ fn parsing_modified_keys() {
modifiers: KeyModifiers::SHIFT | KeyModifiers::CONTROL
}
);
assert_eq!(
str::parse::<KeyEvent>("A-C-+").unwrap(),
KeyEvent {
code: KeyCode::Char('+'),
modifiers: KeyModifiers::ALT | KeyModifiers::CONTROL
}
);
}
#[test]