chore(repo): remove dead code and useless tests (#3375)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-10 21:43:29 +02:00
1 parent 7e177a1c90
commit 1cd62eb661
1391 files changed
+783 -120415

No files matched your search

@@ -184,47 +184,3 @@ pub fn keycode_to_name(code: u16) -> Option<&'static str> {
.find(|(entry_code, _)| *entry_code == code)
.map(|(_, name)| *name)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn keycode_to_name_covers_canonical_letters_and_arrows() {
assert_eq!(keycode_to_name(30), Some("A"));
assert_eq!(keycode_to_name(44), Some("Z"));
assert_eq!(keycode_to_name(119), Some("Pause"));
assert_eq!(keycode_to_name(183), Some("F13"));
assert_eq!(keycode_to_name(96), Some("NumpadEnter"));
assert_eq!(keycode_to_name(113), Some("AudioVolumeMute"));
assert_eq!(keycode_to_name(103), Some("ArrowUp"));
assert_eq!(keycode_to_name(125), Some("MetaLeft"));
assert_eq!(keycode_to_name(0), None);
assert_eq!(keycode_to_name(0xffff), None);
}
#[test]
fn evdev_button_matches_dom_convention() {
assert_eq!(evdev_button_to_browser_button(BTN_LEFT), Some(0));
assert_eq!(evdev_button_to_browser_button(BTN_MIDDLE), Some(1));
assert_eq!(evdev_button_to_browser_button(BTN_RIGHT), Some(2));
assert_eq!(evdev_button_to_browser_button(BTN_SIDE), Some(3));
assert_eq!(evdev_button_to_browser_button(BTN_BACK), Some(3));
assert_eq!(evdev_button_to_browser_button(BTN_EXTRA), Some(4));
assert_eq!(evdev_button_to_browser_button(BTN_FORWARD), Some(4));
assert_eq!(evdev_button_to_browser_button(0x100), None);
assert_eq!(evdev_button_to_browser_button(0xffff), None);
}
#[test]
fn modifier_constants_match_linux_input_event_codes() {
assert_eq!(LEFT_CTRL, 29);
assert_eq!(RIGHT_CTRL, 97);
assert_eq!(LEFT_SHIFT, 42);
assert_eq!(RIGHT_SHIFT, 54);
assert_eq!(LEFT_ALT, 56);
assert_eq!(RIGHT_ALT, 100);
assert_eq!(LEFT_META, 125);
assert_eq!(RIGHT_META, 126);
}
}