1
0
mirror of https://github.com/golang/go synced 2024-11-23 00:50:05 -07:00

Update level_test.go

This commit is contained in:
pgxiaolianzi 2024-02-07 15:41:00 +08:00 committed by GitHub
parent 20dc20bd32
commit dab00d4c20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,13 +53,13 @@ func TestLevelVar(t *testing.T) {
func TestLevelMarshalJSON(t *testing.T) {
want := LevelWarn - 3
want_data := []byte(`"INFO+1"`)
wantData := []byte(`"INFO+1"`)
data, err := want.MarshalJSON()
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(data, want_data) {
t.Errorf("got %s, want %s", string(data), string(want_data))
if !bytes.Equal(data, wantData) {
t.Errorf("got %s, want %s", string(data), string(wantData))
}
var got Level
if err := got.UnmarshalJSON(data); err != nil {
@ -72,13 +72,13 @@ func TestLevelMarshalJSON(t *testing.T) {
func TestLevelMarshalText(t *testing.T) {
want := LevelWarn - 3
want_data := []byte("INFO+1")
wantData := []byte("INFO+1")
data, err := want.MarshalText()
if err != nil {
t.Fatal(err)
}
if !bytes.Equal(data, want_data) {
t.Errorf("got %s, want %s", string(data), string(want_data))
if !bytes.Equal(data, wantData) {
t.Errorf("got %s, want %s", string(data), string(wantData))
}
var got Level
if err := got.UnmarshalText(data); err != nil {