(t *testing.T)
| 23 | ) |
| 24 | |
| 25 | func (s) TestMethodFamily(t *testing.T) { |
| 26 | cases := []struct { |
| 27 | desc string |
| 28 | method string |
| 29 | wantMethodFamily string |
| 30 | }{ |
| 31 | { |
| 32 | desc: "No leading slash", |
| 33 | method: "pkg.service/method", |
| 34 | wantMethodFamily: "pkg.service", |
| 35 | }, |
| 36 | { |
| 37 | desc: "Leading slash", |
| 38 | method: "/pkg.service/method", |
| 39 | wantMethodFamily: "pkg.service", |
| 40 | }, |
| 41 | } |
| 42 | |
| 43 | for _, ut := range cases { |
| 44 | t.Run(ut.desc, func(t *testing.T) { |
| 45 | if got := methodFamily(ut.method); got != ut.wantMethodFamily { |
| 46 | t.Fatalf("methodFamily(%s) = %s, want %s", ut.method, got, ut.wantMethodFamily) |
| 47 | } |
| 48 | }) |
| 49 | } |
| 50 | } |
nothing calls this directly
no test coverage detected