MCPcopy Index your code
hub / github.com/maruel/panicparse / TestSnapshot_ToHTML

Function TestSnapshot_ToHTML

stack/html_test.go:241–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

239}
240
241func TestSnapshot_ToHTML(t *testing.T) {
242 t.Parallel()
243 data := internaltest.PanicOutputs()["race"]
244 if data == nil {
245 t.Skip("-race is unsupported on this platform")
246 }
247 s, _, err := ScanSnapshot(bytes.NewReader(data), io.Discard, DefaultOpts())
248 if err != nil {
249 t.Fatal(err)
250 }
251 if s.Goroutines == nil {
252 t.Fatal("missing context")
253 }
254 if s.Goroutines[0].RaceAddr == 0 {
255 t.Fatal("expected a race")
256 }
257 if !s.IsRace() {
258 t.Fatal("expected a race")
259 }
260 if err := s.ToHTML(io.Discard, ""); err != nil {
261 t.Fatal(err)
262 }
263}
264
265func BenchmarkAggregated_ToHTML(b *testing.B) {
266 b.ReportAllocs()

Callers

nothing calls this directly

Calls 5

PanicOutputsFunction · 0.92
ScanSnapshotFunction · 0.85
DefaultOptsFunction · 0.85
IsRaceMethod · 0.80
ToHTMLMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…