File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
pkg/decision/evaluator/matchers Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,12 @@ func (sv SemanticVersion) splitSemanticVersion(targetedVersion string) ([]string
128128 return []string {}, errors .New (string (reasons .AttributeFormatInvalid ))
129129 }
130130
131+ for i := 0 ; i < len (targetedVersionParts );i ++ {
132+ if ! sv .isNumber (targetedVersionParts [i ]) {
133+ return []string {}, errors .New (string (reasons .AttributeFormatInvalid ))
134+ }
135+ }
136+
131137 targetedVersionParts = append (targetedVersionParts , targetSuffix ... )
132138 return targetedVersionParts , nil
133139}
Original file line number Diff line number Diff line change @@ -199,6 +199,19 @@ func TestInvalidAttributes(t *testing.T) {
199199 37 ,
200200 nil ,
201201 "" ,
202+ "-" ,
203+ "." ,
204+ ".." ,
205+ "+" ,
206+ "+test" ,
207+ " " ,
208+ "2 .3. 0" ,
209+ "2." ,
210+ ".2.2" ,
211+ "3.7.2.2" ,
212+ "3.x" ,
213+ "," ,
214+ "+build-prerelese" ,
202215 }
203216
204217 for _ , matchType := range matchTypes {
You can’t perform that action at this time.
0 commit comments