File tree 1 file changed +33
-0
lines changed 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ package commands
2
+
3
+ import (
4
+ cmds "github.com/ipfs/go-ipfs/commands"
5
+ "strings"
6
+ "testing"
7
+ )
8
+
9
+ func checkHelptextRecursive (t * testing.T , name []string , c * cmds.Command ) {
10
+ if c .Helptext .Tagline == "" {
11
+ t .Errorf ("%s has no tagline!" , strings .Join (name , " " ))
12
+ }
13
+
14
+ if c .Helptext .LongDescription == "" {
15
+ t .Errorf ("%s has no long description!" , strings .Join (name , " " ))
16
+ }
17
+
18
+ if c .Helptext .ShortDescription == "" {
19
+ t .Errorf ("%s has no short description!" , strings .Join (name , " " ))
20
+ }
21
+
22
+ if c .Helptext .Synopsis == "" {
23
+ t .Errorf ("%s has no synopsis!" , strings .Join (name , " " ))
24
+ }
25
+
26
+ for subname , sub := range c .Subcommands {
27
+ checkHelptextRecursive (t , append (name , subname ), sub )
28
+ }
29
+ }
30
+
31
+ func TestHelptexts (t * testing.T ) {
32
+ checkHelptextRecursive (t , []string {"ipfs" }, Root )
33
+ }
You can’t perform that action at this time.
0 commit comments