(t *testing.T)
| 1144 | } |
| 1145 | |
| 1146 | func TestOutputWithContext(t *testing.T) { |
| 1147 | ignoredOut := &bytes.Buffer{} |
| 1148 | out := &bytes.Buffer{} |
| 1149 | log := New(ignoredOut).With().Str("foo", "bar").Logger().Output(out) |
| 1150 | log.Log().Msg("hello world") |
| 1151 | |
| 1152 | if got, want := decodeIfBinaryToString(out.Bytes()), `{"foo":"bar","message":"hello world"}`+"\n"; got != want { |
| 1153 | t.Errorf("invalid log output:\ngot: %v\nwant: %v", got, want) |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | func TestCallerMarshalFunc(t *testing.T) { |
| 1158 | out := &bytes.Buffer{} |
nothing calls this directly
no test coverage detected
searching dependent graphs…