mirror of
https://github.com/ipfs/kubo.git
synced 2025-05-21 00:47:22 +08:00

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>
23 lines
403 B
Go
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())
|
|
}
|