@@ -23,48 +23,47 @@ import (
23
23
"github.com/stretchr/testify/require"
24
24
)
25
25
26
-
27
- func TestValidate (t * testing.T ) {
26
+ func TestValidateQueryOpt (t * testing.T ) {
28
27
testcases := []struct {
29
28
name string
30
29
queryOpts QueryOpts
31
- err error
30
+ err error
32
31
}{
33
32
{
34
33
name : "Valid SIG" ,
35
34
queryOpts : QueryOpts {
36
- CommonArgs : CommonArgs {
37
- Name : "1011-test" ,
35
+ CommonArgs : CommonArgs {
36
+ Name : "1011-test" ,
38
37
},
39
- SIG : []string {"sig-multicluster" },
40
- IncludePRs : true ,
41
- Output : "json" ,
38
+ SIG : []string {"sig-multicluster" },
39
+ IncludePRs : true ,
40
+ Output : "json" ,
42
41
},
43
- err : nil ,
42
+ err : nil ,
44
43
},
45
44
{
46
45
name : "Invalid SIG" ,
47
46
queryOpts : QueryOpts {
48
- CommonArgs : CommonArgs {
49
- Name : "1011-test-xyz" ,
47
+ CommonArgs : CommonArgs {
48
+ Name : "1011-test-xyz" ,
50
49
},
51
- SIG : []string {"sig-xyz" },
52
- IncludePRs : true ,
53
- Output : "json" ,
50
+ SIG : []string {"sig-xyz" },
51
+ IncludePRs : true ,
52
+ Output : "json" ,
54
53
},
55
- err : fmt .Errorf ("No SIG matches any of the passed regular expressions" ),
54
+ err : fmt .Errorf ("No SIG matches any of the passed regular expressions" ),
56
55
},
57
56
{
58
57
name : "Unsupported Output format" ,
59
58
queryOpts : QueryOpts {
60
- CommonArgs : CommonArgs {
61
- Name : "1011-test-testing" ,
59
+ CommonArgs : CommonArgs {
60
+ Name : "1011-test-testing" ,
62
61
},
63
- SIG : []string {"sig-testing" },
64
- IncludePRs : true ,
65
- Output : "PDF" ,
62
+ SIG : []string {"sig-testing" },
63
+ IncludePRs : true ,
64
+ Output : "PDF" ,
66
65
},
67
- err : fmt .Errorf ("unsupported output format: PDF. Valid values: [table json yaml]" ),
66
+ err : fmt .Errorf ("unsupported output format: PDF. Valid values: [table json yaml]" ),
68
67
},
69
68
}
70
69
0 commit comments