From abce1a33568de4d1ffcf46fc17fa5139753d38da Mon Sep 17 00:00:00 2001 From: Marko Kungla Date: Tue, 30 Jan 2024 18:34:10 +0200 Subject: [PATCH] fix: varflag tests for flag parsing Signed-off-by: Marko Kungla --- pkg/vars/varflag/common_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/vars/varflag/common_test.go b/pkg/vars/varflag/common_test.go index 45ffe7a..8e81a7f 100644 --- a/pkg/vars/varflag/common_test.go +++ b/pkg/vars/varflag/common_test.go @@ -98,11 +98,11 @@ func TestNoArgs(t *testing.T) { } flag, _ := New(tt.name, "", "") - if ok, err := flag.Parse([]string{}); ok || !errors.Is(err, ErrParse) { + if ok, err := flag.Parse([]string{}); ok || err != nil { t.Errorf("flag should fail to parse got %t %q", ok, err) } flag2, _ := New(tt.name, "", "") - if ok, err := flag2.Parse(nil); ok || !errors.Is(err, ErrParse) { + if ok, err := flag2.Parse(nil); ok || err != nil { t.Errorf("flag should fail to parse got %t %q", ok, err) } })