diff --git a/pkg/lib/util/path_util.go b/pkg/lib/util/path_util.go index 5e3f8d6..1fc57f3 100644 --- a/pkg/lib/util/path_util.go +++ b/pkg/lib/util/path_util.go @@ -34,7 +34,7 @@ func ParsePathSpec(s string) (spec PathSpec, err error) { spec.ParallelRuns = 1 } - if !ok || spec.Path == "" || spec.ParallelRuns <= 0 { + if !ok || spec.Path == "" || spec.ParallelRuns < 0 { return PathSpec{}, fmt.Errorf("invalid path spec %q", s) } diff --git a/pkg/lib/util/path_util_test.go b/pkg/lib/util/path_util_test.go index a399b96..4097db4 100644 --- a/pkg/lib/util/path_util_test.go +++ b/pkg/lib/util/path_util_test.go @@ -33,6 +33,13 @@ func TestParsePathSpec(t *testing.T) { Path: "baz.json", }, }, + { + s: "0@foobar.json", + expected: PathSpec{ + ParallelRuns: 0, + Path: "foobar.json", + }, + }, } for i := range testCases { @@ -51,7 +58,7 @@ func TestParsePathSpec(t *testing.T) { "", // empty "foo@bar.baz", "1.23@foo.json", // non-digit parallel runs "p@old.syntax", "p5@old.syntax", "p123@old.syntax", // old syntax - "0@foo.json", "-1@foo.json", "-123@foo.json", // zero or negative parallel runs + "-1@foo.json", "-123@foo.json", // negative parallel runs } for _, testCase := range testCases {