1- package intellij
1+ package intellij_test
22
33import (
44 "testing"
@@ -7,29 +7,34 @@ import (
77 "github.com/stretchr/testify/require"
88 "github.com/xinnjie/onekeymap-cli/internal/keymap"
99 "github.com/xinnjie/onekeymap-cli/internal/platform"
10+ "github.com/xinnjie/onekeymap-cli/internal/plugins/intellij"
1011 keymapv1 "github.com/xinnjie/onekeymap-cli/protogen/keymap/v1"
1112)
1213
1314func TestParseKeyBinding_Table (t * testing.T ) {
1415 tests := []struct {
1516 name string
16- in KeyboardShortcutXML
17+ in intellij. KeyboardShortcutXML
1718 want string
1819 wantErr bool
1920 }{
20- {name : "SingleChord" , in : KeyboardShortcutXML {First : "alt HOME" }, want : "alt+home" },
21- {name : "TwoChords" , in : KeyboardShortcutXML {First : "control E" , Second : "control S" }, want : "ctrl+e ctrl+s" },
22- {name : "InvalidFirst" , in : KeyboardShortcutXML {First : "control UNKNOWN_KEY" }, wantErr : true },
21+ {name : "SingleChord" , in : intellij.KeyboardShortcutXML {First : "alt HOME" }, want : "alt+home" },
22+ {
23+ name : "TwoChords" ,
24+ in : intellij.KeyboardShortcutXML {First : "control E" , Second : "control S" },
25+ want : "ctrl+e ctrl+s" ,
26+ },
27+ {name : "InvalidFirst" , in : intellij.KeyboardShortcutXML {First : "control UNKNOWN_KEY" }, wantErr : true },
2328 {
2429 name : "InvalidSecond" ,
25- in : KeyboardShortcutXML {First : "alt HOME" , Second : "control UNKNOWN_KEY" },
30+ in : intellij. KeyboardShortcutXML {First : "alt HOME" , Second : "control UNKNOWN_KEY" },
2631 wantErr : true ,
2732 },
2833 }
2934
3035 for _ , tc := range tests {
3136 t .Run (tc .name , func (t * testing.T ) {
32- kb , err := parseKeyBinding (tc .in )
37+ kb , err := intellij . ParseKeyBinding (tc .in )
3338 if tc .wantErr {
3439 require .Error (t , err )
3540 assert .Nil (t , kb )
@@ -72,7 +77,7 @@ func TestFormatKeybinding_Table(t *testing.T) {
7277 } else {
7378 kb = keymap .MustParseKeyBinding (tc .in )
7479 }
75- ks , err := formatKeybinding (kb )
80+ ks , err := intellij . FormatKeybinding (kb )
7681 if tc .wantErr {
7782 require .Error (t , err )
7883 assert .Nil (t , ks )
0 commit comments