You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('Should fail to validate a PURL object with a version component ',()=>{
126
-
expect(()=>purlValidateHelper(PurlRecordVersion)).to.throw('The PURL version component is currently not supported by the CVE schema: "'+PurlRecordVersion[0].packageURL+'"')
149
+
expect(()=>purlValidateHelper(PurlRecordVersion)).to.throw('The PURL version component is currently not supported by the CVE schema: '+PurlRecordVersion[0].packageURL)
127
150
})
128
151
129
152
it('Should fail to validate a PURL object with one non-empty subpath and at least one empty subpath ',()=>{
130
-
expect(()=>purlValidateHelper(PurlRecordEmptySubpath)).to.throw('Subpaths cannot be empty or contain only a "/": "'+PurlRecordEmptySubpath[0].packageURL+'"')
153
+
expect(()=>purlValidateHelper(PurlRecordEmptySubpath)).to.throw('Subpaths cannot be empty or contain only a /: '+PurlRecordEmptySubpath[0].packageURL)
131
154
})
132
155
133
156
it('Should fail to validate a PURL object with a subpath containing only a "/" ',()=>{
134
-
expect(()=>purlValidateHelper(PurlRecordOnlySlashSubpath)).to.throw('Subpaths cannot be empty or contain only a "/": "'+PurlRecordOnlySlashSubpath[0].packageURL+'"')
157
+
expect(()=>purlValidateHelper(PurlRecordOnlySlashSubpath)).to.throw('Subpaths cannot be empty or contain only a /: '+PurlRecordOnlySlashSubpath[0].packageURL)
135
158
})
136
159
137
160
it('Should fail to validate a PURL object with a subpath equal to "." ',()=>{
138
-
expect(()=>purlValidateHelper(PurlRecordOnlySinglePeriodSubpath)).to.throw('Subpaths cannot be "." or "..": "'+PurlRecordOnlySinglePeriodSubpath[0].packageURL+'"')
161
+
expect(()=>purlValidateHelper(PurlRecordOnlySinglePeriodSubpath)).to.throw('Subpaths cannot be "." or "..": '+PurlRecordOnlySinglePeriodSubpath[0].packageURL)
139
162
})
140
163
141
164
it('Should fail to validate a PURL object with a subpath equal to ".." ',()=>{
142
-
expect(()=>purlValidateHelper(PurlRecordOnlyDoublePeriodSubpath)).to.throw('Subpaths cannot be "." or "..": "'+PurlRecordOnlyDoublePeriodSubpath[0].packageURL+'"')
165
+
expect(()=>purlValidateHelper(PurlRecordOnlyDoublePeriodSubpath)).to.throw('Subpaths cannot be "." or "..": '+PurlRecordOnlyDoublePeriodSubpath[0].packageURL)
166
+
})
167
+
168
+
it('Should fail to validate a PURL object with a # symbol but no subpath ',()=>{
169
+
expect(()=>purlValidateHelper(PurlRecordPoundSymbolEmpty)).to.throw('Subpaths cannot be empty or contain only a /: '+PurlRecordPoundSymbolEmpty[0].packageURL)
143
170
})
144
171
145
172
it('Should fail to validate when at least one PURL object in an array is invalid ',()=>{
146
-
expect(()=>purlValidateHelper(MultipleRecordsOneInvalid)).to.throw('Subpaths cannot be "." or "..": "'+PurlRecordOnlySinglePeriodSubpath[0].packageURL+'"')
173
+
expect(()=>purlValidateHelper(MultipleRecordsOneInvalid)).to.throw('Subpaths cannot be "." or "..": '+PurlRecordOnlySinglePeriodSubpath[0].packageURL)
174
+
})
175
+
176
+
it('Should fail to validate when a version is passed in the qualifier component ',()=>{
177
+
expect(()=>purlValidateHelper(RecordQualifierVersionPurl)).to.throw('PURL versions are currently not supported by the CVE schema: '+RecordQualifierVersionPurl[0].packageURL)
178
+
})
179
+
180
+
it('Should fail to validate when a qualifier has a key and no value ',()=>{
181
+
expect(()=>purlValidateHelper(PurlQualifierKeyNoValueRecord)).to.throw('Qualifier keys must have a value: '+PurlQualifierKeyNoValueRecord[0].packageURL)
182
+
})
183
+
184
+
it('Should fail to validate when a PURL contain an encoded colon ',()=>{
185
+
expect(()=>purlValidateHelper(PurlEncodedColonRecord)).to.throw('Percent-encoded colons are not allowed in a PURL: '+PurlEncodedColonRecord[0].packageURL)
0 commit comments