MCPcopy Index your code
hub / github.com/op/go-logging / TestLevelString

Function TestLevelString

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

Source from the content-addressed store, hash-verified

7import "testing"
8
9func TestLevelString(t *testing.T) {
10 // Make sure all levels can be converted from string -> constant -> string
11 for _, name := range levelNames {
12 level, err := LogLevel(name)
13 if err != nil {
14 t.Errorf("failed to get level: %v", err)
15 continue
16 }
17
18 if level.String() != name {
19 t.Errorf("invalid level conversion: %v != %v", level, name)
20 }
21 }
22}
23
24func TestLevelLogLevel(t *testing.T) {
25 tests := []struct {

Callers

nothing calls this directly

Calls 3

LogLevelFunction · 0.85
ErrorfMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected