forge
Explore
Log in

Don't you dare go Hollow

tests/binds: Add more not-currently-working layouts tests

Browse files at this commit

5f23510779eb8d9f4bc38152b29dd4f2990f5ab5Ivan MolodetskikhParent: 9aa245c
src/tests/binds.rsmodified+63 -0
@@ -527,6 +527,9 @@ fn layouts() {
527 binds {527 binds {
528 Q { close-window; }528 Q { close-window; }
529 Shift+Slash { close-window; }529 Shift+Slash { close-window; }
530+ Cyrillic_ya { close-window; }
531+ Shift+Cyrillic_che { close-window; }
532+ Shift+Cyrillic_ES { close-window; }
530 }533 }
531 "#;534 "#;
532 535
@@ -606,6 +609,66 @@ fn layouts() {
606 surface modifiers: depressed=0, latched=0, locked=0, group=1609 surface modifiers: depressed=0, latched=0, locked=0, group=1
607 "610 "
608 );611 );
612+
613+ // Я should trigger the Cyrillic_ya bind, but it currently doesn't. (Nobody binds keys like this
614+ // in Russia, but people do in other countries with their non-ASCII characters.)
615+ assert_snapshot!(
616+ run(c, "+LALT -LALT +LatZ -LatZ"),
617+ @"
618+ +LALT 64 XK_ISO_Next_Group
619+ surface key pressed: 56
620+ surface modifiers: depressed=0, latched=0, locked=0, group=1
621+ -LALT 64 XK_ISO_Next_Group
622+ surface key released: 56
623+ +AB01 52 XK_Cyrillic_ya
624+ surface key pressed: 44
625+ -AB01 52 XK_Cyrillic_ya
626+ surface key released: 44
627+ "
628+ );
629+
630+ // Non-ASCII binds should also be case-insensitive where reasonable, just like ASCII ones. Or,
631+ // more accurately, the trigger key for a Modifier+key bind should be Modifier-insensitive.
632+ assert_snapshot!(
633+ run(c, "+LALT -LALT +LFSH +LatX -LatX -LFSH"),
634+ @"
635+ +LALT 64 XK_ISO_Next_Group
636+ surface key pressed: 56
637+ surface modifiers: depressed=0, latched=0, locked=0, group=1
638+ -LALT 64 XK_ISO_Next_Group
639+ surface key released: 56
640+ +LFSH 50 XK_Shift_L
641+ surface key pressed: 42
642+ surface modifiers: depressed=1, latched=0, locked=0, group=1
643+ +AB02 53 XK_Cyrillic_CHE
644+ surface key pressed: 45
645+ -AB02 53 XK_Cyrillic_CHE
646+ surface key released: 45
647+ -LFSH 50 XK_Shift_L
648+ surface key released: 42
649+ surface modifiers: depressed=0, latched=0, locked=0, group=1
650+ "
651+ );
652+ assert_snapshot!(
653+ run(c, "+LALT -LALT +LFSH +LatC -LatC -LFSH"),
654+ @"
655+ +LALT 64 XK_ISO_Next_Group
656+ surface key pressed: 56
657+ surface modifiers: depressed=0, latched=0, locked=0, group=1
658+ -LALT 64 XK_ISO_Next_Group
659+ surface key released: 56
660+ +LFSH 50 XK_Shift_L
661+ surface key pressed: 42
662+ surface modifiers: depressed=1, latched=0, locked=0, group=1
663+ +AB03 54 XK_Cyrillic_ES
664+ surface key pressed: 46
665+ -AB03 54 XK_Cyrillic_ES
666+ surface key released: 46
667+ -LFSH 50 XK_Shift_L
668+ surface key released: 42
669+ surface modifiers: depressed=0, latched=0, locked=0, group=1
670+ "
671+ );
609 }672 }
610 673
611 #[test]674 #[test]