mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 17:03:58 +08:00
commands: Fixed tests
This commit is contained in:

committed by
Juan Batiz-Benet

parent
8ee3e996cc
commit
ce28fa363b
@ -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"},
|
||||
|
Reference in New Issue
Block a user