add test case for version parsing with embedded quotes

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman 2021-02-16 09:23:29 -05:00
parent 0a9408005f
commit c5e16bb4a2
No known key found for this signature in database
GPG key ID: 5CB45AE22BAB7EA7

View file

@ -28,6 +28,14 @@ func TestSplitFuzzyPhrase(t *testing.T) {
version: "in<(b e t w e e n)>quotes<=||>=not!=",
},
},
{
// to cover a version that has quotes within it, but not necessarily surrounding the entire version
phrase: ` >= inbet"ween)>quotes" with trailing words `,
expected: &constraintUnit{
rangeOperator: GTE,
version: `inbet"ween)>quotes" with trailing words`,
},
},
{
phrase: `="something"`,
expected: &constraintUnit{