Debian Codegraph @

internal/report/shortnames_test.go

raw symbols SCIP
1 package reportscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/report`/
2
3 import (
4 "reflectscip-go gomod github.com/golang/go/src go1.24.0 reflect/"
5 "testingscip-go gomod github.com/golang/go/src go1.24.0 testing/"
6 )
7
8 func TestShortNamesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/report`/TestShortNames().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) {
9 type testCase struct {
10 name string
11 in string
12 out []string
13 }
14 test := func(name, in string, out ...string) testCase {
15 return testCase{name, in, out}
16 }
17
18 for _, c := range []testCase{
19 test("empty", "", ""),
20 test("simple", "foo", "foo"),
21 test("trailingsep", "foo.bar.", "foo.bar.", "bar."),
22 test("cplusplus", "a::b::c", "a::b::c", "b::c", "c"),
23 test("dotted", "a.b.c", "a.b.c", "b.c", "c"),
24 test("mixed_separators", "a::b.c::d", "a::b.c::d", "b.c::d", "c::d", "d"),
25 test("call_operator", "foo::operator()", "foo::operator()", "operator()"),
26 } {
27 t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().(c.name, func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) {
28 got := shortNameListscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/report`/shortNameList().(c.in)
29 if !reflectscip-go gomod github.com/golang/go/src go1.24.0 reflect/.DeepEqualscip-go gomod github.com/golang/go/src go1.24.0 reflect/DeepEqual().(c.out, got) {
30 t.Errorfscip-go gomod github.com/golang/go/src go1.24.0 testing/common#Errorf().("shortNameList(%q) = %#v, expecting %#v", c.in, got, c.out)
31 }
32 })
33 }
34 }
35
36 func TestFileNameSuffixesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/report`/TestFileNameSuffixes().(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) {
37 type testCase struct {
38 name string
39 in string
40 out []string
41 }
42 test := func(name, in string, out ...string) testCase {
43 return testCase{name, in, out}
44 }
45
46 for _, c := range []testCase{
47 test("empty", "", ""),
48 test("simple", "foo", "foo"),
49 test("manypaths", "a/b/c", "a/b/c", "b/c", "c"),
50 test("leading", "/a/b", "/a/b", "a/b", "b"),
51 test("trailing", "a/b", "a/b", "b"),
52 } {
53 t.Runscip-go gomod github.com/golang/go/src go1.24.0 testing/T#Run().(c.name, func(t *testingscip-go gomod github.com/golang/go/src go1.24.0 testing/.Tscip-go gomod github.com/golang/go/src go1.24.0 testing/T#) {
54 got := fileNameSuffixesscip-go gomod github.com/google/pprof . `github.com/google/pprof/internal/report`/fileNameSuffixes().(c.in)
55 if !reflectscip-go gomod github.com/golang/go/src go1.24.0 reflect/.DeepEqualscip-go gomod github.com/golang/go/src go1.24.0 reflect/DeepEqual().(c.out, got) {
56 t.Errorfscip-go gomod github.com/golang/go/src go1.24.0 testing/common#Errorf().("fileNameSuffixes(%q) = %#v, expecting %#v", c.in, got, c.out)
57 }
58 })
59 }
60 }