Reset master to testing content

This commit is contained in:
Storm Dragon committed 2026-10-25 01:57:54 -04:00
1 parent 0f2587b719
commit 42afa2a56c
1483 files changed
+145308 -938069

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
// Copyright (c) 2026 Storm Dragon
// Authors: Storm Dragon, Angus Kola
// SPDX-License-Identifier: GPL-3.0-or-later
package input
import "testing"
func TestSpeechModeBindings(t *testing.T) {
for _, layout := range []KeyboardLayout{DesktopKeyboardLayout, LaptopKeyboardLayout} {
for _, browse := range []bool{false, true} {
bindings, err := ResolveCommandBindings(layout, browse, nil)
if err != nil {
t.Fatal(err)
}
if got := bindings[CommandChord{Symbol: 's', CthulhuModifier: true}]; got != CycleSpeechMode {
t.Fatalf("layout %d browse %v: %q", layout, browse, got)
}
if got := bindings[CommandChord{Symbol: 's', Modifiers: 1 | controlModifier, CthulhuModifier: true}]; got != SaveSpeechSettings {
t.Fatalf("speech settings save changed: %q", got)
}
if browse && bindings[CommandChord{Symbol: 's'}] != DocumentNextSeparator {
t.Fatal("unmodified separator navigation changed")
}
custom, err := ResolveCommandBindings(layout, browse, []BindingOverride{{
Layout: layout, Scope: "global", Command: CycleSpeechMode, Keys: []string{"Cthulhu+F8"},
}})
if err != nil {
t.Fatal(err)
}
if _, exists := custom[CommandChord{Symbol: 's', CthulhuModifier: true}]; exists {
t.Fatal("custom binding retained the old shortcut")
}
}
}
}