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.
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user