dogger
/
dogger_test.go
49 строк · 805.0 Байт
1package dogger2
3import (4"testing"5
6"github.com/nikwo/dogger/level"7)
8
9func TestLevelTrace(t *testing.T) {10result := level.LogLevelFromString("trace")11if result != level.TRACE {12t.Fail()13}14}
15
16func TestLevelDebug(t *testing.T) {17result := level.LogLevelFromString("debug")18if result != level.DEBUG {19t.Fail()20}21}
22
23func TestLevelInfo(t *testing.T) {24result := level.LogLevelFromString("info")25if result != level.INFO {26t.Fail()27}28}
29
30func TestLevelWarn(t *testing.T) {31result := level.LogLevelFromString("warn")32if result != level.WARN {33t.Fail()34}35}
36
37func TestLevelError(t *testing.T) {38result := level.LogLevelFromString("error")39if result != level.ERROR {40t.Fail()41}42}
43
44func TestDogger(t *testing.T) {45SetLevel(level.TRACE)46Trace(struct {47Hello string48}{Hello: "World"})49}
50