From 44c009678be36400bcb6320d2933c67caa1df421 Mon Sep 17 00:00:00 2001 From: John Behm Date: Sun, 22 Oct 2023 16:03:26 +0200 Subject: [PATCH] update test --- config/config_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config/config_test.go b/config/config_test.go index 244db75..7501d9e 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -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") } @@ -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) } }) }