1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

commands: Fixed tests

This commit is contained in:
Matt Bell
2014-11-10 17:14:35 -08:00
committed by Juan Batiz-Benet
parent 8ee3e996cc
commit ce28fa363b

View File

@ -2,13 +2,17 @@ package commands
import "testing"
func noop(req Request) (interface{}, error) {
return nil, nil
}
func TestOptionValidation(t *testing.T) {
cmd := Command{
Options: []Option{
Option{[]string{"b", "beep"}, Int, "enables beeper"},
Option{[]string{"B", "boop"}, String, "password for booper"},
},
Run: func(res Response, req Request) {},
Run: noop,
}
req := NewEmptyRequest()
@ -79,8 +83,6 @@ func TestOptionValidation(t *testing.T) {
}
func TestRegistration(t *testing.T) {
noop := func(res Response, req Request) {}
cmdA := &Command{
Options: []Option{
Option{[]string{"beep"}, Int, "number of beeps"},