Skip to content

Commit

Permalink
tests(level) : add TestUppercaseString
Browse files Browse the repository at this point in the history
  • Loading branch information
seipan committed Sep 15, 2023
1 parent 721df1e commit abfd79c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions level_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,30 @@ func TestMarshalText(t *testing.T) {
})
}
}

func TestUppercaseString(t *testing.T) {
tests := []struct {
name string
reqlvl Level
reqstr string
}{
{
name: "success info level",
reqlvl: InfoLevel,
reqstr: "INFO",
},
{
name: "success error level",
reqlvl: ErrorLevel,
reqstr: "ERROR",
},
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
res := tt.reqlvl.UppercaseString()
assert.Equal(t, tt.reqstr, res)
})
}
}

0 comments on commit abfd79c

Please sign in to comment.