use super::*;
#[test]
fn recording_active_produces_full_line_banner() {
let mut app = App::new(None, false, None, None).unwrap();
seed_buffer(&mut app, "hello");
drive_key(&mut app, ck('q'));
drive_key(&mut app, ck('a'));
assert!(
app.active().editor.is_recording_macro(),
"prerequisite: qa must start macro recording"
);
assert_eq!(app.active().editor.recording_register(), Some('a'));
let width: u16 = 60;
let text = crate::render::status_line_text(&app, width);
assert!(
text.contains("recording @a"),
"recording active: status line must contain 'recording @a', got {text:?}"
);
assert!(
!text.contains("REC @a"),
"recording banner must NOT contain the lualine badge 'REC @a', got {text:?}"
);
assert_eq!(
text.chars().count(),
width as usize,
"recording banner must fill full width {width}, got {} chars: {text:?}",
text.chars().count()
);
}
#[test]
fn recording_stopped_falls_through_to_normal_bar() {
let mut app = App::new(None, false, None, None).unwrap();
seed_buffer(&mut app, "hello");
drive_key(&mut app, ck('q'));
drive_key(&mut app, ck('a'));
drive_key(&mut app, ck('q')); assert!(
!app.active().editor.is_recording_macro(),
"prerequisite: bare q must stop recording"
);
let width: u16 = 60;
let text = crate::render::status_line_text(&app, width);
assert!(
!text.contains("recording @"),
"after stop: status line must NOT contain recording banner, got {text:?}"
);
assert_eq!(
text.chars().count(),
width as usize,
"normal bar must fill full width {width}, got {}: {text:?}",
text.chars().count()
);
}