1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-04 04:56:16 +08:00
Files
kubo/core/commands/helptext_test.go
keks ef21c3bfab update go-ipfs-cmds to 2.0.0-beta2
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
2018-09-19 14:35:54 -07:00

37 lines
855 B
Go

package commands
import (
"strings"
"testing"
cmds "gx/ipfs/QmSwR1QndLsdnw2mpW2rrywoCUPeY7o8UxtK1dLpPCNFGD/go-ipfs-cmds"
)
func checkHelptextRecursive(t *testing.T, name []string, c *cmds.Command) {
if c.Helptext.Tagline == "" {
t.Errorf("%s has no tagline!", strings.Join(name, " "))
}
if c.Helptext.LongDescription == "" {
t.Errorf("%s has no long description!", strings.Join(name, " "))
}
if c.Helptext.ShortDescription == "" {
t.Errorf("%s has no short description!", strings.Join(name, " "))
}
if c.Helptext.Synopsis == "" {
t.Errorf("%s has no synopsis!", strings.Join(name, " "))
}
for subname, sub := range c.Subcommands {
checkHelptextRecursive(t, append(name, subname), sub)
}
}
func TestHelptexts(t *testing.T) {
t.Skip("sill isn't 100%")
Root.ProcessHelp()
checkHelptextRecursive(t, []string{"ipfs"}, Root)
}