(t *testing.T)
| 3555 | } |
| 3556 | |
| 3557 | func TestPathValues_Get(t *testing.T) { |
| 3558 | var testCases = []struct { |
| 3559 | name string |
| 3560 | whenKey string |
| 3561 | expect string |
| 3562 | expectOK bool |
| 3563 | }{ |
| 3564 | { |
| 3565 | name: "ok", |
| 3566 | whenKey: `tag`, |
| 3567 | expect: `latest`, |
| 3568 | expectOK: true, |
| 3569 | }, |
| 3570 | { |
| 3571 | name: "nok", |
| 3572 | whenKey: `not existent key`, |
| 3573 | expect: "", |
| 3574 | expectOK: false, |
| 3575 | }, |
| 3576 | } |
| 3577 | for _, tc := range testCases { |
| 3578 | t.Run(tc.name, func(t *testing.T) { |
| 3579 | pv := PathValues{ |
| 3580 | {Name: "image", Value: "docker"}, |
| 3581 | {Name: "tag", Value: "latest"}, |
| 3582 | } |
| 3583 | |
| 3584 | result, ok := pv.Get(tc.whenKey) |
| 3585 | assert.Equal(t, tc.expectOK, ok) |
| 3586 | assert.Equal(t, tc.expect, result) |
| 3587 | }) |
| 3588 | } |
| 3589 | } |
| 3590 | |
| 3591 | func TestPathValues_GetOr(t *testing.T) { |
| 3592 | var testCases = []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…