Skip to content

Commit

Permalink
Add a test for set 1: a_down -> a_up -> s_down
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed Nov 11, 2018
1 parent 57a6b5d commit 29fd3f9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lib.rs
Expand Up @@ -794,6 +794,23 @@ mod test {
assert_eq!(codes.len(), 85);
assert_eq!(errs.len(), 171);
}

#[test]
fn test_set_1_down_up_down() {
let mut k = Keyboard::new(layouts::Us104Key, ScancodeSet1);
assert_eq!(
k.add_byte(0x1e),
Ok(Some(KeyEvent::new(KeyCode::A, KeyState::Down)))
);
assert_eq!(
k.add_byte(0x9e),
Ok(Some(KeyEvent::new(KeyCode::A, KeyState::Up)))
);
assert_eq!(
k.add_byte(0x1f),
Ok(Some(KeyEvent::new(KeyCode::S, KeyState::Down)))
);
}
}

// ****************************************************************************
Expand Down

0 comments on commit 29fd3f9

Please sign in to comment.