MCPcopy Index your code
hub / github.com/labstack/echo / TestPathValues_Get

Function TestPathValues_Get

router_test.go:3557–3589  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3555}
3556
3557func 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
3591func TestPathValues_GetOr(t *testing.T) {
3592 var testCases = []struct {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…