1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-21 00:47:22 +08:00
Files
kubo/core/commands/root_test.go
Steven Allen 45fd7d213f pre-populate required arguments from request body
This way, we can always assume that indexing a required argument works.

Also:

* test that the command tree doesn't have any obvious bugs (duplicate options,
  arguments in the wrong order, etc).
* simplify the usage ParseBodyArgs.
* remove unnecessary check in the get command.

fixes #4823

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-03-18 13:04:25 -07:00

23 lines
403 B
Go

package commands
import (
"testing"
)
func TestCommandTree(t *testing.T) {
printErrors := func(errs map[string][]error) {
if errs == nil {
return
}
t.Error("In Root command tree:")
for cmd, err := range errs {
t.Errorf(" In X command %s:", cmd)
for _, e := range err {
t.Errorf(" %s", e)
}
}
}
printErrors(Root.DebugValidate())
printErrors(RootRO.DebugValidate())
}