MCPcopy Create free account
hub / github.com/google/pprof / TestEncodeDecodeDocURL

Function TestEncodeDecodeDocURL

profile/profile_test.go:1872–1892  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1870}
1871
1872func TestEncodeDecodeDocURL(t *testing.T) {
1873 input := testProfile1.Copy()
1874 input.DocURL = "http://example.comp/url"
1875
1876 // Encode/decode.
1877 var buf bytes.Buffer
1878 if err := input.Write(&buf); err != nil {
1879 t.Fatal("encode: ", err)
1880 }
1881 output, err := Parse(&buf)
1882 if err != nil {
1883 t.Fatal("decode: ", err)
1884 }
1885 if want, got := input.String(), output.String(); want != got {
1886 d, err := proftest.Diff([]byte(want), []byte(got))
1887 if err != nil {
1888 t.Fatal(err)
1889 }
1890 t.Errorf("wrong result of encode/decode (-want,+got):\n%s\n", string(d))
1891 }
1892}
1893
1894// parallel runs n copies of fn in parallel.
1895func parallel(n int, fn func()) {

Callers

nothing calls this directly

Calls 5

DiffFunction · 0.92
ParseFunction · 0.85
CopyMethod · 0.80
WriteMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…