Skip to content

Commit bc13380

Browse files
committed
Add failing test for relative url starting with //
See #167.
1 parent 0ff3efb commit bc13380

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib_test/test_runner.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,14 @@ let test_ipv6_parsing =
680680
name >:: test
681681
) ipv6_addresses
682682

683+
let test_make_path_rel_identity =
684+
let path = "//aaa/bbb" in
685+
sprintf "of_string (to_string _) identity:%s" path >:: fun () ->
686+
let u = Uri.make ~path () in
687+
let u' = Uri.of_string (Uri.to_string u) in
688+
assert_equal ~printer:Uri.to_string ~cmp:Uri.equal
689+
u u'
690+
683691
let compat_uris =
684692
[ "http://\nhost"
685693
; "http://host\n/path"
@@ -723,6 +731,7 @@ let _ =
723731
@ test_canonicalize
724732
@ test_with_uri
725733
@ test_ipv6_parsing
734+
@ [ test_make_path_rel_identity ]
726735
) in
727736
let verbose = ref false in
728737
let set_verbose _ = verbose := true in

0 commit comments

Comments
 (0)