@@ -269,7 +269,8 @@ func TestMarshalUpdateIssueFields(t *testing.T) {
269
269
func TestShouldReopen (t * testing.T ) {
270
270
const stack = "stack"
271
271
const gopls = "golang.org/x/tools/gopls"
272
- const milestoneVersion = "v0.2.0"
272
+ goplsMilestone := & Milestone {Title : "gopls/v0.2.0" }
273
+ goMilestone := & Milestone {Title : "Go1.23" }
273
274
274
275
for _ , tc := range []struct {
275
276
name string
@@ -279,44 +280,61 @@ func TestShouldReopen(t *testing.T) {
279
280
}{
280
281
{
281
282
"issue open" ,
282
- Issue {State : "open" },
283
+ Issue {State : "open" , Milestone : goplsMilestone },
283
284
Info {Program : gopls , ProgramVersion : "v0.2.0" },
284
285
false ,
285
286
},
286
287
{
287
288
"issue closed but not fixed" ,
288
- Issue {State : "closed" , StateReason : "not_planned" },
289
+ Issue {State : "closed" , StateReason : "not_planned" , Milestone : goplsMilestone },
289
290
Info {Program : gopls , ProgramVersion : "v0.2.0" },
290
291
false ,
291
292
},
292
293
{
293
294
"different program" ,
294
- Issue {State : "closed" , StateReason : "completed" },
295
+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
295
296
Info {Program : "other" , ProgramVersion : "v0.2.0" },
296
297
false ,
297
298
},
298
299
{
299
300
"later version" ,
300
- Issue {State : "closed" , StateReason : "completed" },
301
+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
301
302
Info {Program : gopls , ProgramVersion : "v0.3.0" },
302
303
true ,
303
304
},
304
305
{
305
306
"earlier version" ,
306
- Issue {State : "closed" , StateReason : "completed" },
307
+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
307
308
Info {Program : gopls , ProgramVersion : "v0.1.0" },
308
309
false ,
309
310
},
310
311
{
311
312
"same version" ,
312
- Issue {State : "closed" , StateReason : "completed" },
313
+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
313
314
Info {Program : gopls , ProgramVersion : "v0.2.0" },
314
315
true ,
315
316
},
317
+ {
318
+ "compiler later version" ,
319
+ Issue {State : "closed" , StateReason : "completed" , Milestone : goMilestone },
320
+ Info {Program : "cmd/compile" , ProgramVersion : "go1.24" },
321
+ true ,
322
+ },
323
+ {
324
+ "compiler earlier version" ,
325
+ Issue {State : "closed" , StateReason : "completed" , Milestone : goMilestone },
326
+ Info {Program : "cmd/compile" , ProgramVersion : "go1.22" },
327
+ false ,
328
+ },
329
+ {
330
+ "compiler same version" ,
331
+ Issue {State : "closed" , StateReason : "completed" , Milestone : goMilestone },
332
+ Info {Program : "cmd/compile" , ProgramVersion : "go1.23" },
333
+ true ,
334
+ },
316
335
} {
317
336
t .Run (tc .name , func (t * testing.T ) {
318
337
tc .issue .Number = 1
319
- tc .issue .Milestone = & Milestone {Title : "gopls/" + milestoneVersion }
320
338
tc .issue .newStacks = []string {stack }
321
339
got := shouldReopen (& tc .issue , map [string ]map [Info ]int64 {stack : map [Info ]int64 {tc .info : 1 }})
322
340
if got != tc .want {
0 commit comments