(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestStackedWiths(t *testing.T) { |
| 160 | out := &bytes.Buffer{} |
| 161 | ctx := New(out).With(). |
| 162 | Bool("bool", true) |
| 163 | ctx = ctx.Logger().With(). |
| 164 | Int("int", 1) |
| 165 | log := ctx.Logger() |
| 166 | log.Log().Msg("") |
| 167 | if got, want := decodeIfBinaryToString(out.Bytes()), |
| 168 | `{"bool":true,"int":1}`+"\n"; got != want { |
| 169 | t.Errorf("invalid log output:\ngot: %v\nwant: %v", got, want) |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | func TestWithPlurals(t *testing.T) { |
| 174 | out := &bytes.Buffer{} |