mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 18:41:10 +00:00
Added tests for alt->meta behavior
This commit is contained in:
parent
9c42b92663
commit
b45d5e83bb
1 changed files with 34 additions and 0 deletions
|
@ -405,6 +405,40 @@ mod test {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn alt_is_meta() {
|
||||
let ascii_printable = ' '..='~';
|
||||
for character in ascii_printable {
|
||||
assert_eq!(
|
||||
to_esc_str(
|
||||
&Keystroke::parse(&format!("alt-{}", character)).unwrap(),
|
||||
&TermMode::NONE,
|
||||
true
|
||||
)
|
||||
.unwrap(),
|
||||
format!("\x1b{}", character)
|
||||
);
|
||||
}
|
||||
|
||||
let gpui_keys = [
|
||||
"up", "down", "right", "left", "f1", "f2", "f3", "f4", "F5", "f6", "f7", "f8", "f9",
|
||||
"f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", "f20", "insert",
|
||||
"pageup", "pagedown", "end", "home",
|
||||
];
|
||||
|
||||
for key in gpui_keys {
|
||||
assert_ne!(
|
||||
to_esc_str(
|
||||
&Keystroke::parse(&format!("alt-{}", key)).unwrap(),
|
||||
&TermMode::NONE,
|
||||
true
|
||||
)
|
||||
.unwrap(),
|
||||
format!("\x1b{}", key)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_modifier_code_calc() {
|
||||
// Code Modifiers
|
||||
|
|
Loading…
Reference in a new issue