@@ -269,7 +269,8 @@ func TestMarshalUpdateIssueFields(t *testing.T) {
269269func TestShouldReopen (t * testing.T ) {
270270 const stack = "stack"
271271 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" }
273274
274275 for _ , tc := range []struct {
275276 name string
@@ -279,44 +280,61 @@ func TestShouldReopen(t *testing.T) {
279280 }{
280281 {
281282 "issue open" ,
282- Issue {State : "open" },
283+ Issue {State : "open" , Milestone : goplsMilestone },
283284 Info {Program : gopls , ProgramVersion : "v0.2.0" },
284285 false ,
285286 },
286287 {
287288 "issue closed but not fixed" ,
288- Issue {State : "closed" , StateReason : "not_planned" },
289+ Issue {State : "closed" , StateReason : "not_planned" , Milestone : goplsMilestone },
289290 Info {Program : gopls , ProgramVersion : "v0.2.0" },
290291 false ,
291292 },
292293 {
293294 "different program" ,
294- Issue {State : "closed" , StateReason : "completed" },
295+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
295296 Info {Program : "other" , ProgramVersion : "v0.2.0" },
296297 false ,
297298 },
298299 {
299300 "later version" ,
300- Issue {State : "closed" , StateReason : "completed" },
301+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
301302 Info {Program : gopls , ProgramVersion : "v0.3.0" },
302303 true ,
303304 },
304305 {
305306 "earlier version" ,
306- Issue {State : "closed" , StateReason : "completed" },
307+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
307308 Info {Program : gopls , ProgramVersion : "v0.1.0" },
308309 false ,
309310 },
310311 {
311312 "same version" ,
312- Issue {State : "closed" , StateReason : "completed" },
313+ Issue {State : "closed" , StateReason : "completed" , Milestone : goplsMilestone },
313314 Info {Program : gopls , ProgramVersion : "v0.2.0" },
314315 true ,
315316 },
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+ },
316335 } {
317336 t .Run (tc .name , func (t * testing.T ) {
318337 tc .issue .Number = 1
319- tc .issue .Milestone = & Milestone {Title : "gopls/" + milestoneVersion }
320338 tc .issue .newStacks = []string {stack }
321339 got := shouldReopen (& tc .issue , map [string ]map [Info ]int64 {stack : map [Info ]int64 {tc .info : 1 }})
322340 if got != tc .want {
0 commit comments