(t *testing.T)
| 303 | } |
| 304 | |
| 305 | func TestCheckOutdatedAlpineRepo(t *testing.T) { |
| 306 | anyToString := func(a any) string { |
| 307 | str, ok := a.(string) |
| 308 | if !ok { |
| 309 | panic("failed to parse param as string") |
| 310 | } |
| 311 | return str |
| 312 | } |
| 313 | |
| 314 | tests := []struct { |
| 315 | name string |
| 316 | fileContent string |
| 317 | latestHTTPVersion string |
| 318 | latestApkVersion string |
| 319 | wantHTTPVersion string |
| 320 | wantApkVersion string |
| 321 | wantAlpineVersion string |
| 322 | track string |
| 323 | }{ |
| 324 | { |
| 325 | name: "up-to-date", |
| 326 | fileContent: "https://dl-cdn.alpinelinux.org/alpine/v3.20/main", |
| 327 | latestHTTPVersion: "1.95.3", |
| 328 | latestApkVersion: "1.95.3", |
| 329 | track: "unstable", |
| 330 | }, |
| 331 | { |
| 332 | name: "behind-unstable", |
| 333 | fileContent: "https://dl-cdn.alpinelinux.org/alpine/v3.20/main", |
| 334 | latestHTTPVersion: "1.95.4", |
| 335 | latestApkVersion: "1.95.3", |
| 336 | wantHTTPVersion: "1.95.4", |
| 337 | wantApkVersion: "1.95.3", |
| 338 | wantAlpineVersion: "v3.20", |
| 339 | track: "unstable", |
| 340 | }, |
| 341 | { |
| 342 | name: "behind-stable", |
| 343 | fileContent: "https://dl-cdn.alpinelinux.org/alpine/v2.40/main", |
| 344 | latestHTTPVersion: "1.94.3", |
| 345 | latestApkVersion: "1.92.1", |
| 346 | wantHTTPVersion: "1.94.3", |
| 347 | wantApkVersion: "1.92.1", |
| 348 | wantAlpineVersion: "v2.40", |
| 349 | track: "stable", |
| 350 | }, |
| 351 | { |
| 352 | name: "nothing-in-dist-file", |
| 353 | fileContent: "", |
| 354 | latestHTTPVersion: "1.94.3", |
| 355 | latestApkVersion: "1.92.1", |
| 356 | wantHTTPVersion: "1.94.3", |
| 357 | wantApkVersion: "1.92.1", |
| 358 | track: "stable", |
| 359 | }, |
| 360 | } |
| 361 | for _, tt := range tests { |
| 362 | t.Run(tt.name, func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…