(t *testing.T)
| 374 | } |
| 375 | |
| 376 | func TestGetReturnCode(t *testing.T) { |
| 377 | |
| 378 | type args struct { |
| 379 | outputs []*Output |
| 380 | ignoreDeprecations bool |
| 381 | ignoreRemovals bool |
| 382 | ignoreReplacementUnavailable bool |
| 383 | } |
| 384 | tests := []struct { |
| 385 | name string |
| 386 | args args |
| 387 | want int |
| 388 | }{ |
| 389 | { |
| 390 | name: "empty return zero", |
| 391 | args: args{ |
| 392 | outputs: []*Output{}, |
| 393 | ignoreDeprecations: false, |
| 394 | ignoreRemovals: false, |
| 395 | ignoreReplacementUnavailable: false, |
| 396 | }, |
| 397 | want: 0, |
| 398 | }, |
| 399 | { |
| 400 | name: "version is deprecated return two", |
| 401 | args: args{ |
| 402 | outputs: []*Output{ |
| 403 | { |
| 404 | APIVersion: &Version{ |
| 405 | DeprecatedIn: "v1.16.0", |
| 406 | RemovedIn: "v1.20.0", |
| 407 | Component: "foo", |
| 408 | }, |
| 409 | }, |
| 410 | }, |
| 411 | ignoreDeprecations: false, |
| 412 | ignoreRemovals: false, |
| 413 | ignoreReplacementUnavailable: false, |
| 414 | }, |
| 415 | want: 4, |
| 416 | }, |
| 417 | { |
| 418 | name: "version is deprecated ignore deprecations", |
| 419 | args: args{ |
| 420 | outputs: []*Output{ |
| 421 | { |
| 422 | APIVersion: &Version{ |
| 423 | DeprecatedIn: "v1.16.0", |
| 424 | RemovedIn: "v1.20.0", |
| 425 | Component: "foo", |
| 426 | }, |
| 427 | }, |
| 428 | }, |
| 429 | ignoreDeprecations: true, |
| 430 | ignoreRemovals: false, |
| 431 | ignoreReplacementUnavailable: false, |
| 432 | }, |
| 433 | want: 4, |
nothing calls this directly
no test coverage detected
searching dependent graphs…