Skip to content

Commit c6ca617

Browse files
ali90hEliahKagan
authored andcommitted
fix gix-url
1 parent 2d8855f commit c6ca617

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gix-url/tests/issue2064_scp_username.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use bstr::{BString, ByteSlice};
22
use gix_url::{parse, Url};
33
#[test]
44
fn scp_like_keeps_username_literal_no_percent_encoding() {
5+
// scp-like keeps username literal in alternative form
56
let cases = [
67
("[email protected]:org/repo.git", "john+doe"),
7-
("foo%bar@host:repo/path", "foo%bar"),
88
("user.name@host:repo", "user.name"),
99
("u_ser-123@host:org/repo", "u_ser-123"),
1010
];
@@ -19,11 +19,13 @@ fn scp_like_keeps_username_literal_no_percent_encoding() {
1919

2020
#[test]
2121
fn ssh_scheme_behavior_unchanged() {
22+
// ssh:// round-trips with canonical form percent encoding
2223
let input = "ssh://[email protected]/org/repo.git";
24+
let expected_output = "ssh://john%[email protected]/org/repo.git";
2325
let url = gix_url::parse(input.as_bytes().as_bstr()).expect("parse ssh://");
2426
assert_eq!(
2527
url.to_bstring().as_bstr(),
26-
input.as_bytes().as_bstr(),
27-
"ssh:// round-trip changed (should remain consistent)"
28+
expected_output.as_bytes().as_bstr(),
29+
"ssh:// canonical form should percent-encode special chars"
2830
);
2931
}

0 commit comments

Comments
 (0)