This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
5
unikernel/duniverse/ocaml-uri/fuzz/dune
Normal file
5
unikernel/duniverse/ocaml-uri/fuzz/dune
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(tests
|
||||
(names fuzz)
|
||||
(package uri-re)
|
||||
(libraries uri uri-re crowbar)
|
||||
(deps (source_tree input)))
|
||||
46
unikernel/duniverse/ocaml-uri/fuzz/fuzz.ml
Normal file
46
unikernel/duniverse/ocaml-uri/fuzz/fuzz.ml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
open Crowbar
|
||||
|
||||
let () =
|
||||
add_test ~name:"create" [bytes] (fun a ->
|
||||
(* Parse \n as this is a known deviation of behaviour *)
|
||||
let a = Str.(global_replace (regexp_string "\n") a "") in
|
||||
let x = try Uri.(of_string a |> to_string) with _ -> "" in
|
||||
let y = try Uri_legacy.(of_string a |> to_string) with _ -> "" in
|
||||
check_eq ~pp:pp_string x y
|
||||
);
|
||||
add_test ~name:"query" [bytes] (fun a ->
|
||||
(* Parse \n as this is a known deviation of behaviour *)
|
||||
let a = Str.(global_replace (regexp_string "\n") a "") in
|
||||
let x = try Uri.(of_string a |> query) with _ -> [] in
|
||||
let y = try Uri_legacy.(of_string a |> query) with _ -> [] in
|
||||
check_eq x y
|
||||
);
|
||||
add_test ~name:"scheme" [bytes] (fun a ->
|
||||
(* Parse \n as this is a known deviation of behaviour *)
|
||||
let a = Str.(global_replace (regexp_string "\n") a "") in
|
||||
let x = try Uri.(of_string a |> scheme) with _ -> None in
|
||||
let y = try Uri_legacy.(of_string a |> scheme) with _ -> None in
|
||||
check_eq x y
|
||||
);
|
||||
add_test ~name:"host" [bytes] (fun a ->
|
||||
(* Parse \n as this is a known deviation of behaviour *)
|
||||
let a = Str.(global_replace (regexp_string "\n") a "") in
|
||||
let x = try Uri.(of_string a |> host) with _ -> None in
|
||||
let y = try Uri_legacy.(of_string a |> host) with _ -> None in
|
||||
check_eq x y
|
||||
);
|
||||
add_test ~name:"userinfo" [bytes] (fun a ->
|
||||
(* Parse \n as this is a known deviation of behaviour *)
|
||||
let a = Str.(global_replace (regexp_string "\n") a "") in
|
||||
let x = try Uri.(of_string a |> userinfo) with _ -> None in
|
||||
let y = try Uri_legacy.(of_string a |> userinfo) with _ -> None in
|
||||
check_eq x y
|
||||
);
|
||||
add_test ~name:"port" [bytes] (fun a ->
|
||||
(* Parse \n as this is a known deviation of behaviour *)
|
||||
let a = Str.(global_replace (regexp_string "\n") a "") in
|
||||
let x = try Uri.(of_string a |> port) with _ -> None in
|
||||
let y = try Uri_legacy.(of_string a |> port) with _ -> None in
|
||||
check_eq x y
|
||||
);
|
||||
|
||||
1
unikernel/duniverse/ocaml-uri/fuzz/input/start
Normal file
1
unikernel/duniverse/ocaml-uri/fuzz/input/start
Normal file
|
|
@ -0,0 +1 @@
|
|||
foo
|
||||
Loading…
Add table
Add a link
Reference in a new issue