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

Function testPanicUTF8

stack/context_test.go:2001–2038  ·  view source on GitHub ↗
(t *testing.T, s *Snapshot, b *bytes.Buffer, ppDir string)

Source from the content-addressed store, hash-verified

1999}
2000
2001func testPanicUTF8(t *testing.T, s *Snapshot, b *bytes.Buffer, ppDir string) {
2002 if s.RemoteGOROOT != "" {
2003 t.Fatalf("RemoteGOROOT is %q", s.RemoteGOROOT)
2004 }
2005 if b.String() != "GOTRACEBACK=all\npanic: 42\n\n" {
2006 t.Fatalf("output: %q", b.String())
2007 }
2008 ver := "/v2"
2009 if !internaltest.IsUsingModules() {
2010 ver = ""
2011 }
2012 want := []*Goroutine{
2013 {
2014 Signature: Signature{
2015 State: "running",
2016 Stack: Stack{
2017 Calls: []Call{
2018 newCallLocal(
2019 // This is important to note here the inconsistency in the Go
2020 // runtime stack generator. The path is escaped, but symbols are
2021 // not.
2022 "github.com/maruel/panicparse"+ver+"/cmd/panic/internal/utf8.(*Strùct).Pànic",
2023 Args{Values: []Arg{{Value: 1, IsInaccurate: true}}},
2024 // See TestCallUTF8 in stack_test.go for exercising the methods on
2025 // Call in this situation.
2026 pathJoin(ppDir, "internal", "utf8", "utf8.go"),
2027 10),
2028 newCallLocal("main.init.func21", Args{}, pathJoin(ppDir, "main.go"), 322),
2029 newCallLocal("main.main", Args{}, pathJoin(ppDir, "main.go"), 340),
2030 },
2031 },
2032 },
2033 ID: 1,
2034 First: true,
2035 },
2036 }
2037 similarGoroutines(t, want, s.Goroutines)
2038}
2039
2040// TestPanicweb implements the parsing of panicweb output.
2041//

Callers

nothing calls this directly

Calls 5

IsUsingModulesFunction · 0.92
pathJoinFunction · 0.85
similarGoroutinesFunction · 0.85
newCallLocalFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…