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
128
128
return []string {}, errors .New (string (reasons .AttributeFormatInvalid ))
129
129
}
130
130
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
+
131
137
targetedVersionParts = append (targetedVersionParts , targetSuffix ... )
132
138
return targetedVersionParts , nil
133
139
}
Original file line number Diff line number Diff line change @@ -199,6 +199,19 @@ func TestInvalidAttributes(t *testing.T) {
199
199
37 ,
200
200
nil ,
201
201
"" ,
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" ,
202
215
}
203
216
204
217
for _ , matchType := range matchTypes {
You can’t perform that action at this time.
0 commit comments