add test case for #3526

This commit is contained in:
Wez Furlong committed 2023-04-15 15:50:50 -07:00
1 parent 46bc9f57c5
commit addeb9e248
1 file changed
+31
+31
View File
@@ -2644,4 +2644,35 @@ mod test {
"\x1b[1092:1060:97;6;1060u".to_string()
);
}
#[test]
fn encode_issue_3526() {
let flags = KittyKeyboardFlags::DISAMBIGUATE_ESCAPE_CODES;
assert_eq!(
KeyEvent {
key: KeyCode::Char(' '),
modifiers: Modifiers::NONE,
leds: KeyboardLedStatus::NUM_LOCK,
repeat_count: 1,
key_is_down: true,
raw: None
}
.encode_kitty(flags),
" ".to_string()
);
assert_eq!(
KeyEvent {
key: KeyCode::Char(' '),
modifiers: Modifiers::NONE,
leds: KeyboardLedStatus::CAPS_LOCK,
repeat_count: 1,
key_is_down: true,
raw: None
}
.encode_kitty(flags),
" ".to_string()
);
}
}