| 47 | } |
| 48 | |
| 49 | func TestWarninglnNotEqualToWarning(t *testing.T) { |
| 50 | buf := &bytes.Buffer{} |
| 51 | bufln := &bytes.Buffer{} |
| 52 | |
| 53 | formatter := new(TextFormatter) |
| 54 | formatter.DisableTimestamp = true |
| 55 | formatter.DisableLevelTruncation = true |
| 56 | |
| 57 | l := &Logger{ |
| 58 | Out: buf, |
| 59 | Formatter: formatter, |
| 60 | Hooks: make(LevelHooks), |
| 61 | Level: DebugLevel, |
| 62 | } |
| 63 | l.Warning("hello,", "world") |
| 64 | |
| 65 | l.SetOutput(bufln) |
| 66 | l.Warningln("hello,", "world") |
| 67 | |
| 68 | assert.NotEqual(t, buf.String(), bufln.String(), "Warning() and Wantingln() should not be equal") |
| 69 | } |
| 70 | |
| 71 | type testBufferPool struct { |
| 72 | buffers []*bytes.Buffer |