MCPcopy
hub / github.com/grpc/grpc-go / TestMethodFamily

Method TestMethodFamily

trace_test.go:25–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func (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}

Callers

nothing calls this directly

Calls 2

methodFamilyFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected