Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
jxsl13 committed Oct 22, 2023
1 parent 314db22 commit 44c0096
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ func TestParse(t *testing.T) {
t.Fatal(err)
}

c := NewConfig()

err = c.UnmarshalText(b)
c, err := NewConfigFromText(b)
if err != nil {
t.Fatal(err)
}

if len(c) == 0 {
t.Fatalf("parsed 0 commands")
}
Expand Down Expand Up @@ -63,11 +62,11 @@ func TestParseLine(t *testing.T) {
var got Command
err := got.UnmarshalText(data)
if (err != nil) != tt.wantErr {
t.Errorf("ParseLine() error = %v, wantErr %v", err, tt.wantErr)
t.Errorf("UnmarshalText() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("ParseLine() = %v, want %v", got, tt.want)
t.Errorf("UnmarshalText() = %v, want %v", got, tt.want)
}
})
}
Expand Down

0 comments on commit 44c0096

Please sign in to comment.