Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More with-* tests #54

Merged
merged 2 commits into from
Aug 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib_test/test_runner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,13 @@ let test_with_change =
assert_equal uri uri2;
let exp = "f%20o%20o://foo.bar/a/b/c" in
let msg = sprintf "%s <> %s" (Uri.to_string uri3) exp in
assert_equal ~msg (Uri.to_string uri3) exp
assert_equal ~msg (Uri.to_string uri3) exp;
let uri_empty = Uri.of_string "" in
let uri = Uri.with_scheme uri_empty (Some "http") in
let uri_s = Uri.to_string uri in
let uri_exp = "http://" in
let msg = sprintf "with_scheme empty (%s <> %s).string" uri_s uri_exp in
assert_equal ~msg uri_s uri_exp
);

"test_with_userinfo" >:: (fun () ->
Expand Down Expand Up @@ -450,6 +456,10 @@ let test_with_change =
let uri = Uri.of_string "" in
let uri_empty = Uri.with_path uri "" in
assert_equal ~msg:"empty host empty path" uri uri_empty;
let uri_pct = Uri.with_path uri "%2F" in
let msg = sprintf "empty host percent / path (%s <> %s)"
(Uri.to_string uri_pct) "%2F" in
assert_equal ~msg (Uri.to_string uri_pct) "%2F";
let uri_some = Uri.with_path uri "a" in
assert_equal ~msg:"empty host some path" (Uri.of_string "a") uri_some;
let uri = Uri.of_string "//" in
Expand Down