From 322020f75714912d9fff2ceeb026fca5fed6a2af Mon Sep 17 00:00:00 2001 From: Ridwan Hoq Date: Sat, 2 Dec 2023 00:09:42 +0000 Subject: [PATCH] add ../ as a valid prefix test Signed-off-by: Ridwan Hoq --- packageurl_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packageurl_test.go b/packageurl_test.go index ad93762..db4151b 100644 --- a/packageurl_test.go +++ b/packageurl_test.go @@ -499,6 +499,19 @@ func TestNormalize(t *testing.T) { Qualifiers: packageurl.Qualifiers{}, Subpath: "./sub/path", }, + }, { + name: "'../' is a valid subpath prefix", + input: packageurl.PackageURL{ + Type: "npm", + Name: "pkg", + Subpath: "../sub/path", + }, + want: packageurl.PackageURL{ + Type: "npm", + Name: "pkg", + Qualifiers: packageurl.Qualifiers{}, + Subpath: "../sub/path", + }, }, { name: "known type namespace adjustments", input: packageurl.PackageURL{