@@ -57,16 +57,16 @@ func TestGenerate(t *testing.T) {
57
57
Ranges : []AffectsRange {
58
58
{
59
59
Type : TypeSemver ,
60
- Fixed : "v2 .1.1" ,
60
+ Fixed : "2 .1.1" ,
61
61
},
62
62
{
63
63
Type : TypeSemver ,
64
- Introduced : "v2 .3.4" ,
65
- Fixed : "v2 .3.5" ,
64
+ Introduced : "2 .3.4" ,
65
+ Fixed : "2 .3.5" ,
66
66
},
67
67
{
68
68
Type : TypeSemver ,
69
- Introduced : "v2 .5.0" ,
69
+ Introduced : "2 .5.0" ,
70
70
},
71
71
},
72
72
},
@@ -96,16 +96,16 @@ func TestGenerate(t *testing.T) {
96
96
Ranges : []AffectsRange {
97
97
{
98
98
Type : TypeSemver ,
99
- Fixed : "v2 .1.1" ,
99
+ Fixed : "2 .1.1" ,
100
100
},
101
101
{
102
102
Type : TypeSemver ,
103
- Introduced : "v2 .3.4" ,
104
- Fixed : "v2 .3.5" ,
103
+ Introduced : "2 .3.4" ,
104
+ Fixed : "2 .3.5" ,
105
105
},
106
106
{
107
107
Type : TypeSemver ,
108
- Introduced : "v2 .5.0" ,
108
+ Introduced : "2 .5.0" ,
109
109
},
110
110
},
111
111
},
@@ -146,7 +146,7 @@ func TestAffectsSemver(t *testing.T) {
146
146
// v1.0.0 < v2.0.0
147
147
affects : Affects {
148
148
Ranges : []AffectsRange {
149
- {Type : TypeSemver , Fixed : "v2 .0.0" },
149
+ {Type : TypeSemver , Fixed : "2 .0.0" },
150
150
},
151
151
},
152
152
version : "v1.0.0" ,
@@ -156,7 +156,7 @@ func TestAffectsSemver(t *testing.T) {
156
156
// v0.0.1 <= v1.0.0
157
157
affects : Affects {
158
158
Ranges : []AffectsRange {
159
- {Type : TypeSemver , Introduced : "v0 .0.1" },
159
+ {Type : TypeSemver , Introduced : "0 .0.1" },
160
160
},
161
161
},
162
162
version : "v1.0.0" ,
@@ -166,7 +166,7 @@ func TestAffectsSemver(t *testing.T) {
166
166
// v1.0.0 <= v1.0.0
167
167
affects : Affects {
168
168
Ranges : []AffectsRange {
169
- {Type : TypeSemver , Introduced : "v1 .0.0" },
169
+ {Type : TypeSemver , Introduced : "1 .0.0" },
170
170
},
171
171
},
172
172
version : "v1.0.0" ,
@@ -176,7 +176,7 @@ func TestAffectsSemver(t *testing.T) {
176
176
// v1.0.0 <= v1.0.0 < v2.0.0
177
177
affects : Affects {
178
178
Ranges : []AffectsRange {
179
- {Type : TypeSemver , Introduced : "v1 .0.0" , Fixed : "v2 .0.0" },
179
+ {Type : TypeSemver , Introduced : "1 .0.0" , Fixed : "2 .0.0" },
180
180
},
181
181
},
182
182
version : "v1.0.0" ,
@@ -186,7 +186,7 @@ func TestAffectsSemver(t *testing.T) {
186
186
// v0.0.1 <= v1.0.0 < v2.0.0
187
187
affects : Affects {
188
188
Ranges : []AffectsRange {
189
- {Type : TypeSemver , Introduced : "v0 .0.1" , Fixed : "v2 .0.0" },
189
+ {Type : TypeSemver , Introduced : "0 .0.1" , Fixed : "2 .0.0" },
190
190
},
191
191
},
192
192
version : "v1.0.0" ,
@@ -196,7 +196,7 @@ func TestAffectsSemver(t *testing.T) {
196
196
// v2.0.0 < v3.0.0
197
197
affects : Affects {
198
198
Ranges : []AffectsRange {
199
- {Type : TypeSemver , Introduced : "v1 .0.0" , Fixed : "v2 .0.0" },
199
+ {Type : TypeSemver , Introduced : "1 .0.0" , Fixed : "2 .0.0" },
200
200
},
201
201
},
202
202
version : "v3.0.0" ,
@@ -206,8 +206,8 @@ func TestAffectsSemver(t *testing.T) {
206
206
// Multiple ranges
207
207
affects : Affects {
208
208
Ranges : []AffectsRange {
209
- {Type : TypeSemver , Introduced : "v1 .0.0" , Fixed : "v2 .0.0" },
210
- {Type : TypeSemver , Introduced : "v3 .0.0" },
209
+ {Type : TypeSemver , Introduced : "1 .0.0" , Fixed : "2 .0.0" },
210
+ {Type : TypeSemver , Introduced : "3 .0.0" },
211
211
},
212
212
},
213
213
version : "v3.0.0" ,
@@ -217,7 +217,7 @@ func TestAffectsSemver(t *testing.T) {
217
217
// Wrong type range
218
218
affects : Affects {
219
219
Ranges : []AffectsRange {
220
- {Type : TypeUnspecified , Introduced : "v3 .0.0" },
220
+ {Type : TypeUnspecified , Introduced : "3 .0.0" },
221
221
},
222
222
},
223
223
version : "v3.0.0" ,
@@ -227,8 +227,8 @@ func TestAffectsSemver(t *testing.T) {
227
227
// Semver ranges don't match
228
228
affects : Affects {
229
229
Ranges : []AffectsRange {
230
- {Type : TypeUnspecified , Introduced : "v3 .0.0" },
231
- {Type : TypeSemver , Introduced : "v4 .0.0" },
230
+ {Type : TypeUnspecified , Introduced : "3 .0.0" },
231
+ {Type : TypeSemver , Introduced : "4 .0.0" },
232
232
},
233
233
},
234
234
version : "v3.0.0" ,
@@ -238,13 +238,23 @@ func TestAffectsSemver(t *testing.T) {
238
238
// Semver ranges do match
239
239
affects : Affects {
240
240
Ranges : []AffectsRange {
241
- {Type : TypeUnspecified , Introduced : "v3 .0.0" },
242
- {Type : TypeSemver , Introduced : "v3 .0.0" },
241
+ {Type : TypeUnspecified , Introduced : "3 .0.0" },
242
+ {Type : TypeSemver , Introduced : "3 .0.0" },
243
243
},
244
244
},
245
245
version : "v3.0.0" ,
246
246
want : true ,
247
247
},
248
+ {
249
+ // Semver ranges match (go prefix)
250
+ affects : Affects {
251
+ Ranges : []AffectsRange {
252
+ {Type : TypeSemver , Introduced : "3.0.0" },
253
+ },
254
+ },
255
+ version : "go3.0.1" ,
256
+ want : true ,
257
+ },
248
258
}
249
259
250
260
for _ , c := range cases {
0 commit comments