Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6cbe65d

Browse files
committed
Reorder tests and add username assertion placeholders
1 parent 55f379b commit 6cbe65d

1 file changed

Lines changed: 30 additions & 5 deletions

File tree

gix-url/tests/access/mod.rs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ mod canonicalized {
3030
}
3131
}
3232

33+
#[test]
34+
fn user() -> crate::Result {
35+
let mut url = gix_url::parse("https://user:password@host/path".into())?;
36+
37+
assert_eq!(url.user(), Some("user"));
38+
assert_eq!(url.set_user(Some("new-user".into())), Some("user".into()));
39+
assert_eq!(url.user(), Some("new-user"));
40+
41+
Ok(())
42+
}
43+
3344
#[test]
3445
fn password() -> crate::Result {
3546
let mut url = gix_url::parse("https://user:password@host/path".into())?;
@@ -42,33 +53,47 @@ fn password() -> crate::Result {
4253
}
4354

4455
#[test]
45-
fn user() -> crate::Result {
46-
let mut url = gix_url::parse("https://user:password@host/path".into())?;
56+
fn user_argument_safe() -> crate::Result {
57+
let url = gix_url::parse("ssh://-Fconfigfile@foo/bar".into())?;
4758

48-
assert_eq!(url.user(), Some("user"));
49-
assert_eq!(url.set_user(Some("new-user".into())), Some("user".into()));
50-
assert_eq!(url.user(), Some("new-user"));
59+
// FIXME: Add the critical assertions for the user argument here.
60+
61+
assert_eq!(url.host(), Some("foo"));
62+
assert_eq!(url.host_argument_safe(), Some("foo"));
63+
64+
assert_eq!(url.path, "/bar");
65+
assert_eq!(url.path_argument_safe(), Some("/bar".into()));
5166

5267
Ok(())
5368
}
5469

5570
#[test]
5671
fn host_argument_safe() -> crate::Result {
5772
let url = gix_url::parse("ssh://-oProxyCommand=open$IFS-aCalculator/foo".into())?;
73+
74+
// FIXME: Add assertions for the user argument here.
75+
5876
assert_eq!(url.host(), Some("-oProxyCommand=open$IFS-aCalculator"));
5977
assert_eq!(url.host_argument_safe(), None);
78+
6079
assert_eq!(url.path, "/foo");
6180
assert_eq!(url.path_argument_safe(), Some("/foo".into()));
81+
6282
Ok(())
6383
}
6484

6585
#[test]
6686
fn path_argument_safe() -> crate::Result {
6787
let url = gix_url::parse("ssh://foo/-oProxyCommand=open$IFS-aCalculator".into())?;
88+
89+
// FIXME: Add assertions for the user argument here.
90+
6891
assert_eq!(url.host(), Some("foo"));
6992
assert_eq!(url.host_argument_safe(), Some("foo"));
93+
7094
assert_eq!(url.path, "/-oProxyCommand=open$IFS-aCalculator");
7195
assert_eq!(url.path_argument_safe(), None);
96+
7297
Ok(())
7398
}
7499

0 commit comments

Comments
 (0)