Phase 6: Plattformprüfungen und absolute RGB-Farben, Change 05 archivieren
This commit is contained in:
@@ -530,3 +530,35 @@ fn comment_only_source_change_also_requires_revision_choice() {
|
||||
DialogKind::ResumeRevision
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn platform_probe_records_each_basic_key_once_and_keeps_ide_keys_out() {
|
||||
let t = Temp::new();
|
||||
let log = t.0.join("platform-events.log");
|
||||
let source = include_str!("../../../tests/platform/input.frm")
|
||||
.replace("platform-events.log", &log.to_string_lossy());
|
||||
let path = t.0.join("input.frm");
|
||||
fs::write(&path, source).unwrap();
|
||||
let mut a = t.app("");
|
||||
a.load_initial_project(path).unwrap();
|
||||
a.execute(Command::Start);
|
||||
tick(&mut a);
|
||||
key(&mut a, K::Char('a'), M::NONE);
|
||||
tick(&mut a);
|
||||
a.handle(Event::Key(KeyEvent::new_with_kind(
|
||||
K::Char('a'),
|
||||
M::NONE,
|
||||
crossterm::event::KeyEventKind::Release,
|
||||
)));
|
||||
tick(&mut a);
|
||||
let events = fs::read_to_string(&log).unwrap();
|
||||
assert_eq!(
|
||||
events.replace('\r', ""),
|
||||
"Down: 97 : 0 \nPress: 97 : 0 \nUp: 97 : 0 \n"
|
||||
);
|
||||
edit_window(&mut a);
|
||||
key(&mut a, K::F(1), M::NONE);
|
||||
tick(&mut a);
|
||||
assert_eq!(fs::read_to_string(&log).unwrap(), events);
|
||||
assert!(matches!(a.active_window().unwrap().kind, WindowKind::Help));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user