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:
parent
20dc20bd32
commit
dab00d4c20
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user