Add test two_mod_taps_same_hand_hold_til_timeout.

This commit is contained in:
Pascal Getreuer 2024-11-13 22:47:28 -08:00
parent bd7e54a31d
commit 6b558247db
2 changed files with 68 additions and 0 deletions

View File

@ -199,6 +199,40 @@ TEST_F(ChordalHoldHoldOnOtherKeyPress, hold_mod_tap_key) {
VERIFY_AND_CLEAR(driver); VERIFY_AND_CLEAR(driver);
} }
TEST_F(ChordalHoldHoldOnOtherKeyPress, two_mod_taps_same_hand_hold_til_timeout) {
TestDriver driver;
InSequence s;
auto mod_tap_key1 = KeymapKey(0, MATRIX_COLS - 2, 0, RCTL_T(KC_A));
auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_B));
set_keymap({mod_tap_key1, mod_tap_key2});
// Press mod-tap keys.
EXPECT_NO_REPORT(driver);
mod_tap_key1.press();
run_one_scan_loop();
mod_tap_key2.press();
run_one_scan_loop();
VERIFY_AND_CLEAR(driver);
// Continue holding til the tapping term.
EXPECT_REPORT(driver, (KC_RIGHT_CTRL));
EXPECT_REPORT(driver, (KC_RIGHT_CTRL, KC_RIGHT_SHIFT));
idle_for(TAPPING_TERM);
VERIFY_AND_CLEAR(driver);
// Release mod-tap keys.
EXPECT_REPORT(driver, (KC_RIGHT_SHIFT));
mod_tap_key1.release();
run_one_scan_loop();
VERIFY_AND_CLEAR(driver);
EXPECT_EMPTY_REPORT(driver);
mod_tap_key2.release();
run_one_scan_loop();
VERIFY_AND_CLEAR(driver);
}
TEST_F(ChordalHoldHoldOnOtherKeyPress, two_mod_taps_nested_press_opposite_hands) { TEST_F(ChordalHoldHoldOnOtherKeyPress, two_mod_taps_nested_press_opposite_hands) {
TestDriver driver; TestDriver driver;
InSequence s; InSequence s;

View File

@ -204,6 +204,40 @@ TEST_F(ChordalHoldPermissiveHold, hold_mod_tap_key) {
VERIFY_AND_CLEAR(driver); VERIFY_AND_CLEAR(driver);
} }
TEST_F(ChordalHoldPermissiveHold, two_mod_taps_same_hand_hold_til_timeout) {
TestDriver driver;
InSequence s;
auto mod_tap_key1 = KeymapKey(0, MATRIX_COLS - 2, 0, RCTL_T(KC_A));
auto mod_tap_key2 = KeymapKey(0, MATRIX_COLS - 1, 0, RSFT_T(KC_B));
set_keymap({mod_tap_key1, mod_tap_key2});
// Press mod-tap keys.
EXPECT_NO_REPORT(driver);
mod_tap_key1.press();
run_one_scan_loop();
mod_tap_key2.press();
run_one_scan_loop();
VERIFY_AND_CLEAR(driver);
// Continue holding til the tapping term.
EXPECT_REPORT(driver, (KC_RIGHT_CTRL));
EXPECT_REPORT(driver, (KC_RIGHT_CTRL, KC_RIGHT_SHIFT));
idle_for(TAPPING_TERM);
VERIFY_AND_CLEAR(driver);
// Release mod-tap keys.
EXPECT_REPORT(driver, (KC_RIGHT_SHIFT));
mod_tap_key1.release();
run_one_scan_loop();
VERIFY_AND_CLEAR(driver);
EXPECT_EMPTY_REPORT(driver);
mod_tap_key2.release();
run_one_scan_loop();
VERIFY_AND_CLEAR(driver);
}
TEST_F(ChordalHoldPermissiveHold, two_mod_taps_nested_press_opposite_hands) { TEST_F(ChordalHoldPermissiveHold, two_mod_taps_nested_press_opposite_hands) {
TestDriver driver; TestDriver driver;
InSequence s; InSequence s;