package hotkey import "testing" func TestGetKeyNameForPlatformRightModifier(t *testing.T) { tests := []struct { name string goos string vk int want string }{ {name: "darwin left command", goos: "darwin", vk: 0x5B, want: "L-⌘"}, {name: "darwin right command", goos: "darwin", vk: 0x5C, want: "R-⌘"}, {name: "unset", goos: "darwin", vk: 0, want: ""}, {name: "windows left windows", goos: "windows", vk: 0x5B, want: "L-Win"}, {name: "windows right windows", goos: "windows", vk: 0x5C, want: "R-Win"}, {name: "linux right windows fallback", goos: "linux", vk: 0x5C, want: "R-Win"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if got := GetKeyNameForPlatform(tt.vk, tt.goos); got != tt.want { t.Fatalf("GetKeyNameForPlatform(0x%X, %q) = %q, want %q", tt.vk, tt.goos, got, tt.want) } }) } }