MCPcopy Index your code
hub / github.com/go-errors/errors / TestParsePanic

Function TestParsePanic

parse_panic_test.go:106–142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104 StackFrame{File: "/0/go/src/github.com/loopj/bugsnag-example-apps/go/revelapp/app/controllers/app.go", LineNumber: 14, Name: "App.Index", Package: "github.com/loopj/bugsnag-example-apps/go/revelapp/app/controllers", ProgramCounter: 0x0})
105
106func TestParsePanic(t *testing.T) {
107
108 todo := map[string]string{
109 "createdBy": createdBy,
110 "normalSplit": normalSplit,
111 "lastGoroutine": lastGoroutine,
112 }
113
114 for key, val := range todo {
115 Err, err := ParsePanic(val)
116
117 if err != nil {
118 t.Fatal(err)
119 }
120
121 if Err.TypeName() != "panic" {
122 t.Errorf("Wrong type: %s", Err.TypeName())
123 }
124
125 if Err.Error() != "hello!" {
126 t.Errorf("Wrong message: %s", Err.TypeName())
127 }
128
129 if Err.StackFrames()[0].Func() != nil {
130 t.Errorf("Somehow managed to find a func...")
131 }
132
133 result := result
134 if key == "createdBy" {
135 result = resultCreatedBy
136 }
137
138 if !reflect.DeepEqual(Err.StackFrames(), result) {
139 t.Errorf("Wrong stack for %s: %#v", key, Err.StackFrames())
140 }
141 }
142}

Callers

nothing calls this directly

Calls 5

ParsePanicFunction · 0.85
TypeNameMethod · 0.80
FuncMethod · 0.80
StackFramesMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…