File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const ENCODE_SET: &AsciiSet = &percent_encoding::CONTROLS
30
30
// .add(b':')
31
31
. add ( b';' )
32
32
. add ( b'=' )
33
+ . add ( b'+' )
33
34
. add ( b'@' )
34
35
. add ( b'\\' )
35
36
. add ( b'[' )
@@ -406,7 +407,7 @@ mod tests {
406
407
)
407
408
. unwrap ( ) ;
408
409
let encoded = purl. to_string ( ) ;
409
- assert_eq ! ( encoded, "pkg:deb/ubuntu/gnome-calculator@1:41.1-2ubuntu2?vcs_url=git+https ://salsa.debian.org/gnome-team/gnome-calculator.git%40debian/1%2541.1-2" ) ;
410
+ assert_eq ! ( encoded, "pkg:deb/ubuntu/gnome-calculator@1:41.1-2ubuntu2?vcs_url=git%2Bhttps ://salsa.debian.org/gnome-team/gnome-calculator.git%40debian/1%2541.1-2" ) ;
410
411
}
411
412
412
413
#[ cfg( feature = "serde" ) ]
@@ -427,4 +428,17 @@ mod tests {
427
428
428
429
assert_eq ! ( purl, purl2) ;
429
430
}
431
+
432
+ #[ test]
433
+ fn test_plus_sign_in_version ( ) {
434
+ let expected = "pkg:type/name@1%2Bx" ;
435
+ for purl in [
436
+ "pkg:type/name@1+x" ,
437
+ "pkg:type/name@1%2bx" ,
438
+ "pkg:type/name@1%2Bx" ,
439
+ ] {
440
+ let actual = PackageUrl :: from_str ( purl) . unwrap ( ) . to_string ( ) ;
441
+ assert_eq ! ( actual, expected) ;
442
+ }
443
+ }
430
444
}
You can’t perform that action at this time.
0 commit comments