(t *testing.T)
| 105 | } |
| 106 | |
| 107 | func TestNew(t *testing.T) { |
| 108 | |
| 109 | err := New("foo") |
| 110 | |
| 111 | if err.Error() != "foo" { |
| 112 | t.Errorf("Wrong message") |
| 113 | } |
| 114 | |
| 115 | err = New(fmt.Errorf("foo")) |
| 116 | |
| 117 | if err.Error() != "foo" { |
| 118 | t.Errorf("Wrong message") |
| 119 | } |
| 120 | |
| 121 | bs := [][]uintptr{New("foo").stack, callers()} |
| 122 | |
| 123 | if err := compareStacks(bs[0], bs[1]); err != nil { |
| 124 | t.Errorf("Stack didn't match") |
| 125 | t.Errorf(err.Error()) |
| 126 | } |
| 127 | |
| 128 | if err.ErrorStack() != err.TypeName()+" "+err.Error()+"\n"+string(err.Stack()) { |
| 129 | t.Errorf("ErrorStack is in the wrong format") |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | // This test should work for any go version |
| 134 | func TestIs(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…