()
| 7 | |
| 8 | #[test] |
| 9 | pub 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…