-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheck_data_test.go
63 lines (62 loc) · 1.4 KB
/
check_data_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
var tests = []struct {
name string
subject string
wantErr bool
}{
{
name: "valid type and severity",
subject: "BUG/MEDIUM: config: add default location of path to the configuration file",
wantErr: false,
},
{
name: "invalid type and ok severity err front",
subject: "aaaBUG/MEDIUM: config: add default location of path to the configuration file",
wantErr: true,
},
{
name: "invalid type and ok severity err back",
subject: "BUG/MEDIUMaaa: config: add default location of path to the configuration file",
wantErr: true,
},
{
name: "short subject",
subject: "BUG/MEDIUM: config: default",
wantErr: true,
},
{
name: "missing severity",
subject: "BUG/: config: default implementation",
wantErr: true,
},
{
name: "only severity",
subject: "MINOR: config: default implementation",
wantErr: false,
},
{
name: "wrong tag",
subject: "WRONG: config: default implementation",
wantErr: true,
},
{
name: "wrong severity",
subject: "BUG/WRONG: config: default implementation",
wantErr: true,
},
{
name: "double spaces",
subject: "BUG/MEDIUM: config: default implementation",
wantErr: true,
},
{
name: "trailing spaces",
subject: "BUG/MEDIUM: config: default implementation ",
wantErr: true,
},
{
name: "unprocessed tags remain",
subject: "BUG/MINOR: MAJOR: config: default implementation",
wantErr: true,
},
}