(t *testing.T)
| 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 | |
| 106 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…