Skip to content

Commit b62a07f

Browse files
committed
test(coverage): batch 18 — accessibility/keys key-state probes (tinyhumansai#530)
Add tests for is_tab_key_down/is_escape_key_down (platform-safe), macOS-specific constant validation. All 4216 tests pass.
1 parent d0aa96d commit b62a07f

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

‎src/openhuman/accessibility/keys.rs‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,32 @@ const KCG_EVENT_SOURCE_STATE_COMBINED_SESSION_STATE: i32 = 0;
103103
const KVK_TAB: u16 = 48;
104104
#[cfg(target_os = "macos")]
105105
const KVK_ESCAPE: u16 = 53;
106+
107+
#[cfg(test)]
108+
mod tests {
109+
use super::*;
110+
111+
#[test]
112+
fn is_tab_key_down_returns_bool() {
113+
// Just verify it doesn't panic and returns a bool.
114+
let _result: bool = is_tab_key_down();
115+
}
116+
117+
#[test]
118+
fn is_escape_key_down_returns_bool() {
119+
let _result: bool = is_escape_key_down();
120+
}
121+
122+
#[cfg(target_os = "macos")]
123+
#[test]
124+
fn input_monitoring_recheck_interval_is_positive() {
125+
assert!(INPUT_MONITORING_RECHECK_MS > 0);
126+
}
127+
128+
#[cfg(target_os = "macos")]
129+
#[test]
130+
fn kvk_constants_are_correct() {
131+
assert_eq!(KVK_TAB, 48);
132+
assert_eq!(KVK_ESCAPE, 53);
133+
}
134+
}

0 commit comments

Comments
 (0)