提交 ce28fa36 作者: Matt Bell 提交者: Juan Batiz-Benet

commands: Fixed tests

上级 8ee3e996
...@@ -2,13 +2,17 @@ package commands ...@@ -2,13 +2,17 @@ package commands
import "testing" import "testing"
func noop(req Request) (interface{}, error) {
return nil, nil
}
func TestOptionValidation(t *testing.T) { func TestOptionValidation(t *testing.T) {
cmd := Command{ cmd := Command{
Options: []Option{ Options: []Option{
Option{[]string{"b", "beep"}, Int, "enables beeper"}, Option{[]string{"b", "beep"}, Int, "enables beeper"},
Option{[]string{"B", "boop"}, String, "password for booper"}, Option{[]string{"B", "boop"}, String, "password for booper"},
}, },
Run: func(res Response, req Request) {}, Run: noop,
} }
req := NewEmptyRequest() req := NewEmptyRequest()
...@@ -79,8 +83,6 @@ func TestOptionValidation(t *testing.T) { ...@@ -79,8 +83,6 @@ func TestOptionValidation(t *testing.T) {
} }
func TestRegistration(t *testing.T) { func TestRegistration(t *testing.T) {
noop := func(res Response, req Request) {}
cmdA := &Command{ cmdA := &Command{
Options: []Option{ Options: []Option{
Option{[]string{"beep"}, Int, "number of beeps"}, Option{[]string{"beep"}, Int, "number of beeps"},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论