MCPcopy Create free account
hub / github.com/emberian/evdev / test_get_key_state

Function test_get_key_state

tests/device.rs:9–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8#[test]
9pub fn test_get_key_state() -> Result<(), Box<dyn std::error::Error>> {
10 let (input, mut output) = get_test_device()?;
11
12 output.emit(&[key_event(KeyCode::KEY_DOT, 1)])?;
13
14 assert_eq!(1, input.get_key_state()?.iter().count());
15 assert!(input
16 .get_key_state()?
17 .iter()
18 .all(|e| e.code() == KeyCode::KEY_DOT.code()));
19
20 output.emit(&[key_event(KeyCode::KEY_DOT, 0)])?;
21
22 assert_eq!(0, input.get_key_state()?.iter().count());
23
24 Ok(())
25}

Callers

nothing calls this directly

Calls 3

get_test_deviceFunction · 0.85
key_eventFunction · 0.85
emitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…