We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01a928e commit 37f6413Copy full SHA for 37f6413
nvim/types_test.go
@@ -1,6 +1,7 @@
1
package nvim
2
3
import (
4
+ "reflect"
5
"testing"
6
)
7
@@ -54,3 +55,33 @@ func TestLogLevel_String(t *testing.T) {
54
55
})
56
}
57
58
+
59
+func TestUserCommand(t *testing.T) {
60
+ t.Parallel()
61
62
+ uc := reflect.TypeOf((*UserCommand)(nil)).Elem()
63
64
+ tests := map[string]struct {
65
+ u UserCommand
66
+ }{
67
+ "UserVimCommand": {
68
+ u: UserVimCommand(""),
69
+ },
70
+ "UserLuaCommand": {
71
+ u: UserLuaCommand{},
72
73
+ }
74
+ for name, tt := range tests {
75
+ tt := tt
76
+ t.Run(name, func(t *testing.T) {
77
78
79
+ v := reflect.TypeOf(tt.u)
80
+ if !v.Implements(uc) {
81
+ t.Fatalf("%s type not implements %q interface", v.Name(), "UserCommand")
82
83
84
+ tt.u.command()
85
+ })
86
87
+}
0 commit comments