From 13799b8af9c8aa1e937270aefa518d663fc7ddad Mon Sep 17 00:00:00 2001 From: vasilito Date: Tue, 7 Jul 2026 15:18:52 +0300 Subject: [PATCH] W64: Test for hex navigation Tab toggle Add unit test verifying that Tab in hex mode toggles the hexview_in_text flag (MC CK_ToggleNavigation parity). Tests: 1423 pass (was 1422), zero warnings. --- local/recipes/tui/tlc/source/src/viewer/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/local/recipes/tui/tlc/source/src/viewer/mod.rs b/local/recipes/tui/tlc/source/src/viewer/mod.rs index 4d9d96606b..eaf476bc7e 100644 --- a/local/recipes/tui/tlc/source/src/viewer/mod.rs +++ b/local/recipes/tui/tlc/source/src/viewer/mod.rs @@ -1987,6 +1987,18 @@ mod tests { assert!(!v.show_help); } + #[test] + fn hex_navigation_tab_toggles() { + let p = make_hex_file("nav.bin", &[0x01, 0x02]); + let mut v = Viewer::open(&p).unwrap(); + v.mode = ViewMode::Hex; + assert!(!v.hexview_in_text); + v.handle_key(Key::TAB); + assert!(v.hexview_in_text); + v.handle_key(Key::TAB); + assert!(!v.hexview_in_text); + } + fn k(c: char) -> Key { Key { code: c as u32, mods: crate::key::Modifiers::empty() } }