31 lines
1.2 KiB
Go
31 lines
1.2 KiB
Go
// Copyright (c) 2026 Storm Dragon
|
|
// Authors: Storm Dragon, Angus Kola
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package input
|
|
|
|
import "testing"
|
|
|
|
func TestNotificationCommandBindingsMatchReference(t *testing.T) {
|
|
for name, bindings := range map[string]CommandBindings{
|
|
"desktop": DefaultCommandBindings(DesktopKeyboardLayout),
|
|
"laptop": DefaultCommandBindings(LaptopKeyboardLayout),
|
|
"desktop browse": BrowseCommandBindings(DesktopKeyboardLayout),
|
|
"laptop browse": BrowseCommandBindings(LaptopKeyboardLayout),
|
|
} {
|
|
t.Run(name, func(t *testing.T) {
|
|
if got := bindings[CommandChord{Symbol: 'n', CthulhuModifier: true}]; got != PresentLastNotification {
|
|
t.Fatalf("Cthulhu+N = %q, want %q", got, PresentLastNotification)
|
|
}
|
|
if got := bindings[CommandChord{Symbol: 'n', Modifiers: controlModifier, CthulhuModifier: true}]; got != ShowNotificationList {
|
|
t.Fatalf("Cthulhu+Ctrl+N = %q, want %q", got, ShowNotificationList)
|
|
}
|
|
for chord, command := range bindings {
|
|
if command == PresentPreviousNotification || command == PresentNextNotification {
|
|
t.Fatalf("reference leaves %s unbound; found chord %#v", command, chord)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
}
|