@@ -8,29 +8,48 @@ import (
8
8
)
9
9
10
10
func checkHelptextRecursive (t * testing.T , name []string , c * cmds.Command ) {
11
- if c .Helptext .Tagline == "" {
12
- t .Errorf ("%s has no tagline!" , strings .Join (name , " " ))
13
- }
14
-
15
- if c .Helptext .LongDescription == "" {
16
- t .Errorf ("%s has no long description!" , strings .Join (name , " " ))
17
- }
18
-
19
- if c .Helptext .ShortDescription == "" {
20
- t .Errorf ("%s has no short description!" , strings .Join (name , " " ))
21
- }
22
-
23
- if c .Helptext .Synopsis == "" {
24
- t .Errorf ("%s has no synopsis!" , strings .Join (name , " " ))
25
- }
11
+ c .ProcessHelp ()
12
+
13
+ t .Run (strings .Join (name , "_" ), func (t * testing.T ) {
14
+ if c .External {
15
+ t .Skip ("external" )
16
+ }
17
+
18
+ t .Run ("tagline" , func (t * testing.T ) {
19
+ if c .Helptext .Tagline == "" {
20
+ t .Error ("no Tagline!" )
21
+ }
22
+ })
23
+
24
+ t .Run ("longDescription" , func (t * testing.T ) {
25
+ t .Skip ("not everywhere yet" )
26
+ if c .Helptext .LongDescription == "" {
27
+ t .Error ("no LongDescription!" )
28
+ }
29
+ })
30
+
31
+ t .Run ("shortDescription" , func (t * testing.T ) {
32
+ t .Skip ("not everywhere yet" )
33
+ if c .Helptext .ShortDescription == "" {
34
+ t .Error ("no ShortDescription!" )
35
+ }
36
+ })
37
+
38
+ t .Run ("synopsis" , func (t * testing.T ) {
39
+ t .Skip ("autogenerated in go-ipfs-cmds" )
40
+ if c .Helptext .Synopsis == "" {
41
+ t .Error ("no Synopsis!" )
42
+ }
43
+ })
44
+ })
26
45
27
46
for subname , sub := range c .Subcommands {
28
47
checkHelptextRecursive (t , append (name , subname ), sub )
29
48
}
30
49
}
31
50
32
51
func TestHelptexts (t * testing.T ) {
33
- t .Skip ("sill isn't 100%" )
52
+ // t.Skip("sill isn't 100%")
34
53
Root .ProcessHelp ()
35
54
checkHelptextRecursive (t , []string {"ipfs" }, Root )
36
55
}
0 commit comments