diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-07 15:48:58 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-07 15:48:58 +0300 |
| commit | ed0c051c55e40c1ab3cdc029ba4ca518ee407a1e (patch) | |
| tree | 3c515192394da2caaca2c63eb93152ed308841b8 /src/input/tests.rs | |
| parent | 0276da6f2a44da493d1c198bcc6b5a8b1d2fda44 (diff) | |
fix: preserve lf in raw terminal input
Diffstat (limited to 'src/input/tests.rs')
| -rw-r--r-- | src/input/tests.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/input/tests.rs b/src/input/tests.rs index a3c71675..6482b245 100644 --- a/src/input/tests.rs +++ b/src/input/tests.rs @@ -462,6 +462,19 @@ fn parse_legacy_ctrl_c_sequence() { } #[test] +fn parse_legacy_lf_sequence_as_ctrl_j() { + let key = parse_terminal_key_sequence("\n").unwrap(); + assert_eq!(key.code, KeyCode::Char('j')); + assert_eq!(key.modifiers, KeyModifiers::CONTROL); +} + +#[test] +fn legacy_lf_roundtrips_as_lf() { + let key = parse_terminal_key_sequence("\n").unwrap(); + assert_eq!(encode_terminal_key(key, KeyboardProtocol::Legacy), b"\n"); +} + +#[test] fn legacy_ctrl_byte_matrix_is_covered() { for (byte, expected) in [ (b'\x01', 'a'), |
