MCPcopy Create free account
hub / github.com/TyberiusPrime/KeyToKey / check_output

Function check_output

src/test_helpers.rs:70–91  ·  view source on GitHub ↗
(keyboard: &Keyboard<KeyOutCatcher>, should: &[&[KeyCode]])

Source from the content-addressed store, hash-verified

68}
69#[cfg(test)]
70pub 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
93pub struct TimeoutLogger {
94 keycode: KeyCode,

Callers 15

pcMethod · 0.85
rcMethod · 0.85
tcMethod · 0.85
pctMethod · 0.85
rctMethod · 0.85
test_dvorak_bracketsFunction · 0.85
test_oneshot_shiftFunction · 0.85
test_oneshot_interactionFunction · 0.85
test_abortFunction · 0.85

Calls 1

to_u8Method · 0.80

Tested by

no test coverage detected