(t *testing.T)
| 97 | } |
| 98 | |
| 99 | func TestErrArrayBrokenEncoder(t *testing.T) { |
| 100 | t.Parallel() |
| 101 | |
| 102 | failWith := errors.New("great sadness") |
| 103 | err := (brokenArrayObjectEncoder{ |
| 104 | Err: failWith, |
| 105 | ObjectEncoder: zapcore.NewMapObjectEncoder(), |
| 106 | }).AddArray("errors", errArray{ |
| 107 | errors.New("foo"), |
| 108 | errors.New("bar"), |
| 109 | }) |
| 110 | require.Error(t, err, "Expected error from broken encoder.") |
| 111 | assert.ErrorIs(t, err, failWith, "Unexpected error.") |
| 112 | } |
| 113 | |
| 114 | // brokenArrayObjectEncoder is an ObjectEncoder |
| 115 | // that builds a broken ArrayEncoder. |
nothing calls this directly
no test coverage detected