MCPcopy Create free account
hub / github.com/op/go-logging / TestLevelLogLevel

Function TestLevelLogLevel

level_test.go:24–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestLevelLogLevel(t *testing.T) {
25 tests := []struct {
26 expected Level
27 level string
28 }{
29 {-1, "bla"},
30 {INFO, "iNfO"},
31 {ERROR, "error"},
32 {WARNING, "warninG"},
33 }
34
35 for _, test := range tests {
36 level, err := LogLevel(test.level)
37 if err != nil {
38 if test.expected == -1 {
39 continue
40 } else {
41 t.Errorf("failed to convert %s: %s", test.level, err)
42 }
43 }
44 if test.expected != level {
45 t.Errorf("failed to convert %s to level: %s != %s", test.level, test.expected, level)
46 }
47 }
48}
49
50func TestLevelModuleLevel(t *testing.T) {
51 backend := NewMemoryBackend(128)

Callers

nothing calls this directly

Calls 2

LogLevelFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…