Skip to content

Commit

Permalink
Add and ignore failing test cases for urljoin()
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Oct 23, 2023
1 parent f098e93 commit 5aacfc5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/client/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,16 @@ mod tests {
}

#[rstest]
#[case("foo#bar", "https://api.github.com/foo%23bar")]
#[case("foo%bar", "https://api.github.com/foo%25bar")]
#[case("foo/bar", "https://api.github.com/foo%2Fbar")]
#[case("foo?bar", "https://api.github.com/foo%3Fbar")]
#[case("foo#bar", "https://api.github.com/base/foo%23bar")]
#[case("foo%bar", "https://api.github.com/base/foo%25bar")]
#[case("foo/bar", "https://api.github.com/base/foo%2Fbar")]
#[case("foo?bar", "https://api.github.com/base/foo%3Fbar")]
#[ignore]
#[case(".", "https://api.github.com/base/%2E")]
#[ignore]
#[case("..", "https://api.github.com/base/%2E%2E")]
fn test_urljoin_special_chars(#[case] path: &str, #[case] expected: &str) {
let base = Url::parse("https://api.github.com").unwrap();
let base = Url::parse("https://api.github.com/base").unwrap();
let u = urljoin(&base, [path]);
assert_eq!(u.as_str(), expected);
}
Expand Down

0 comments on commit 5aacfc5

Please sign in to comment.