// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package pprof import ( "bytes" "fmt" "internal/profile" "io" "net/http" "net/http/httptest" "runtime" "runtime/pprof" "strings" "sync" "sync/atomic" "testing" "time" ) // TestDescriptions checks that the profile names under runtime/pprof package // have a key in the description map. func TestDescriptions(t *testing.T) { for _, p := range pprof.Profiles() { _, ok := profileDescriptions[p.Name()] if ok != true { t.Errorf("%s does not exist in profileDescriptions map\n", p.Name()) } } } func TestHandlers(t *testing.T) { testCases := []struct { path string handler http.HandlerFunc statusCode int contentType string contentDisposition string resp []byte }{ {"/debug/pprof/