upstream: https://github.com/stedolan/crowbar
1open Crowbar
2open Astring
3open Fpath
4let fpath =
5 map [bytes] (fun s ->
6 try
7 v s
8 with
9 Invalid_argument _ -> bad_test ())
10
11let suite =
12 ("fpath",
13 [
14 test_case "segs" [fpath] @@ fun p ->
15 let np = normalize p in
16 assert (is_dir_path p = is_dir_path np);
17 assert (is_file_path p = is_file_path np);
18 assert (filename p = filename np);
19 check_eq ~eq:equal p (v @@ (fst @@ split_volume p) ^ (String.concat ~sep:dir_sep (segs p)));
20 ])
21
22let () = run "crowbar" [ suite ]