From 5f23510779eb8d9f4bc38152b29dd4f2990f5ab5 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 28 Sep 2026 10:55:22 +0300 Subject: [PATCH] tests/binds: Add more not-currently-working layouts tests --- src/tests/binds.rs | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/tests/binds.rs b/src/tests/binds.rs index 9e3150ee..33109d44 100644 --- a/src/tests/binds.rs +++ b/src/tests/binds.rs @@ -527,6 +527,9 @@ fn layouts() { binds { Q { close-window; } Shift+Slash { close-window; } + Cyrillic_ya { close-window; } + Shift+Cyrillic_che { close-window; } + Shift+Cyrillic_ES { close-window; } } "#; @@ -606,6 +609,66 @@ fn layouts() { surface modifiers: depressed=0, latched=0, locked=0, group=1 " ); + + // Я should trigger the Cyrillic_ya bind, but it currently doesn't. (Nobody binds keys like this + // in Russia, but people do in other countries with their non-ASCII characters.) + assert_snapshot!( + run(c, "+LALT -LALT +LatZ -LatZ"), + @" + +LALT 64 XK_ISO_Next_Group + surface key pressed: 56 + surface modifiers: depressed=0, latched=0, locked=0, group=1 + -LALT 64 XK_ISO_Next_Group + surface key released: 56 + +AB01 52 XK_Cyrillic_ya + surface key pressed: 44 + -AB01 52 XK_Cyrillic_ya + surface key released: 44 + " + ); + + // Non-ASCII binds should also be case-insensitive where reasonable, just like ASCII ones. Or, + // more accurately, the trigger key for a Modifier+key bind should be Modifier-insensitive. + assert_snapshot!( + run(c, "+LALT -LALT +LFSH +LatX -LatX -LFSH"), + @" + +LALT 64 XK_ISO_Next_Group + surface key pressed: 56 + surface modifiers: depressed=0, latched=0, locked=0, group=1 + -LALT 64 XK_ISO_Next_Group + surface key released: 56 + +LFSH 50 XK_Shift_L + surface key pressed: 42 + surface modifiers: depressed=1, latched=0, locked=0, group=1 + +AB02 53 XK_Cyrillic_CHE + surface key pressed: 45 + -AB02 53 XK_Cyrillic_CHE + surface key released: 45 + -LFSH 50 XK_Shift_L + surface key released: 42 + surface modifiers: depressed=0, latched=0, locked=0, group=1 + " + ); + assert_snapshot!( + run(c, "+LALT -LALT +LFSH +LatC -LatC -LFSH"), + @" + +LALT 64 XK_ISO_Next_Group + surface key pressed: 56 + surface modifiers: depressed=0, latched=0, locked=0, group=1 + -LALT 64 XK_ISO_Next_Group + surface key released: 56 + +LFSH 50 XK_Shift_L + surface key pressed: 42 + surface modifiers: depressed=1, latched=0, locked=0, group=1 + +AB03 54 XK_Cyrillic_ES + surface key pressed: 46 + -AB03 54 XK_Cyrillic_ES + surface key released: 46 + -LFSH 50 XK_Shift_L + surface key released: 42 + surface modifiers: depressed=0, latched=0, locked=0, group=1 + " + ); } #[test]