(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestContextOnWrappedErrors(t *testing.T) { |
| 57 | err := NewFatalError(errors.New("go error")) |
| 58 | |
| 59 | SetContext(err, "foo", "bar") |
| 60 | |
| 61 | if v := GetContext(err, "foo"); v != "bar" { |
| 62 | t.Error("expected to be able to use context on wrapped errors") |
| 63 | } |
| 64 | |
| 65 | ctxt := Context(err) |
| 66 | if ctxt["foo"] != "bar" { |
| 67 | t.Error("expected to get the context of an error") |
| 68 | } |
| 69 | |
| 70 | DelContext(err, "foo") |
| 71 | |
| 72 | if v := GetContext(err, "foo"); v == "bar" { |
| 73 | t.Errorf("expected to delete from error context") |
| 74 | } |
| 75 | } |
nothing calls this directly
no test coverage detected