-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel_test.go
More file actions
50 lines (48 loc) · 817 Bytes
/
level_test.go
File metadata and controls
50 lines (48 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package log
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestLevel_String(t *testing.T) {
tests := []struct {
name string
lvl Level
want string
}{
{
name: "must returns debug string",
lvl: LevelDebug,
want: "Debug",
},
{
name: "must returns info string",
lvl: LevelInfo,
want: "Info",
},
{
name: "must returns warning string",
lvl: LevelWarning,
want: "Warning",
},
{
name: "must returns error string",
lvl: LevelError,
want: "Error",
},
{
name: "must returns fatal string",
lvl: LevelFatal,
want: "Fatal",
},
{
name: "must returns unknown string",
lvl: 10,
want: "Unknown",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
assert.Equal(t, tt.lvl.String(), tt.want)
})
}
}