(keyboard: &Keyboard<KeyOutCatcher>, should: &[&[KeyCode]])
| 68 | } |
| 69 | #[cfg(test)] |
| 70 | pub fn check_output(keyboard: &Keyboard<KeyOutCatcher>, should: &[&[KeyCode]]) { |
| 71 | if !(should.len() == keyboard.output.reports.len()) { |
| 72 | dbg!(&keyboard.output.reports); |
| 73 | dbg!(&should); |
| 74 | } |
| 75 | assert!(should.len() == keyboard.output.reports.len()); |
| 76 | for (ii, report) in should.iter().enumerate() { |
| 77 | if !(keyboard.output.reports[ii].len() == report.len()) { |
| 78 | dbg!(&keyboard.output.reports); |
| 79 | dbg!(&should); |
| 80 | } |
| 81 | assert!(keyboard.output.reports[ii].len() == report.len()); |
| 82 | for k in report.iter() { |
| 83 | let kcu: u8 = (*k).to_u8(); |
| 84 | if !(keyboard.output.reports[ii].contains(&kcu)) { |
| 85 | dbg!(&keyboard.output.reports); |
| 86 | dbg!(&should); |
| 87 | } |
| 88 | assert!(keyboard.output.reports[ii].contains(&kcu)); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | /// send a key whenever a time out occurs |
| 93 | pub struct TimeoutLogger { |
| 94 | keycode: KeyCode, |
no test coverage detected