Skip to content

Commit 62a8a4b

Browse files
ridhoqsschuberth
authored andcommitted
add ./ as a valid test case
Signed-off-by: Ridwan Hoq <ridwanhoq@microsoft.com>
1 parent a8ae119 commit 62a8a4b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packageurl_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,19 @@ func TestNormalize(t *testing.T) {
486486
Subpath: "/sub/../path/",
487487
},
488488
wantErr: true,
489+
}, {
490+
name: "'./' is a valid subpath prefix",
491+
input: packageurl.PackageURL{
492+
Type: "npm",
493+
Name: "pkg",
494+
Subpath: "./sub/path",
495+
},
496+
want: packageurl.PackageURL{
497+
Type: "npm",
498+
Name: "pkg",
499+
Qualifiers: packageurl.Qualifiers{},
500+
Subpath: "./sub/path",
501+
},
489502
}, {
490503
name: "known type namespace adjustments",
491504
input: packageurl.PackageURL{

0 commit comments

Comments
 (0)