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

Function TestLevelUnmarshalText

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

Source from the content-addressed store, hash-verified

25}
26
27func TestLevelUnmarshalText(t *testing.T) {
28 var u logrus.Level
29 for _, level := range logrus.AllLevels {
30 t.Run(level.String(), func(t *testing.T) {
31 require.NoError(t, u.UnmarshalText([]byte(level.String())))
32 require.Equal(t, level, u)
33 })
34 }
35 t.Run("invalid", func(t *testing.T) {
36 require.Error(t, u.UnmarshalText([]byte("invalid")))
37 })
38}
39
40func TestLevelMarshalText(t *testing.T) {
41 levelStrings := []string{

Callers

nothing calls this directly

Calls 3

UnmarshalTextMethod · 0.95
ErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…