MCPcopy
hub / github.com/sirupsen/logrus / TestWarninglnNotEqualToWarning

Function TestWarninglnNotEqualToWarning

logger_test.go:49–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func 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
71type testBufferPool struct {
72 buffers []*bytes.Buffer

Callers

nothing calls this directly

Calls 4

WarningMethod · 0.95
SetOutputMethod · 0.95
WarninglnMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected