@@ -8,56 +8,57 @@ let root = "."
88let short_path = " a/b/c"
99let long_path = List. init 20 ~f: (fun _ -> " foo-bar-baz" ) |> String. concat ~sep: " /"
1010
11- let % bench_fun (" is_root" [@ params
12- path
13- = [ " root" , " ."
14- ; " short path" , short_path
15- ; " long path" , long_path
16- ]])
11+ let % bench_fun
12+ (" is_root"
13+ [@ params path = [ " root" , " ." ; " short path" , short_path; " long path" , long_path ]])
1714 =
1815 fun () -> ignore (Fpath. is_root path)
1916;;
2017
21- let % bench_fun ( " reach " [ @ params
22- t
23- = [ " from root long path " , (long_path, root)
24- ; " from root short path " , (short_path, root)
25- ; " reach root from short path" , (root, short_path )
26- ; " reach root from long path" , (root, long_path )
27- ; ( " reach long path from similar long path"
28- , ( Filename. concat long_path " a "
29- , Filename. concat long_path " b " ) )
30- ; ( " reach short path from similar short path "
31- , ( Filename. concat short_path " a "
32- , Filename. concat short_path " b" ) )
33- ]])
18+ let % bench_fun
19+ ( " reach "
20+ [ @ params
21+ t
22+ = [ " from root long path" , (long_path, root )
23+ ; " from root short path" , (short_path, root )
24+ ; " reach root from short path" , (root, short_path)
25+ ; " reach root from long path " , (root, long_path)
26+ ; ( " reach long path from similar long path "
27+ , ( Filename. concat long_path " a " , Filename. concat long_path " b " ) )
28+ ; ( " reach short path from similar short path "
29+ , ( Filename. concat short_path " a " , Filename. concat short_path " b" ) )
30+ ]])
3431 =
3532 let t, from = t in
3633 let t = Path. of_string t in
3734 let from = Path. of_string from in
3835 fun () -> ignore (Path. reach t ~from )
3936;;
4037
41- let % bench_fun (" Path.Local.relative" [@ params
42- t
43- = [ " left root" , (" ." , long_path)
44- ; " right root" , (long_path, " ." )
45- ; " short paths" , (short_path, short_path)
46- ; " long paths" , (long_path, long_path)
47- ]])
38+ let % bench_fun
39+ (" Path.Local.relative"
40+ [@ params
41+ t
42+ = [ " left root" , (" ." , long_path)
43+ ; " right root" , (long_path, " ." )
44+ ; " short paths" , (short_path, short_path)
45+ ; " long paths" , (long_path, long_path)
46+ ]])
4847 =
4948 let x, y = t in
5049 let x = Path.Local. of_string x in
5150 fun () -> ignore (Path.Local. relative x y)
5251;;
5352
54- let % bench_fun (" Path.Local.append" [@ params
55- t
56- = [ " left root" , (" ." , long_path)
57- ; " right root" , (long_path, " ." )
58- ; " short paths" , (short_path, short_path)
59- ; " long paths" , (long_path, long_path)
60- ]])
53+ let % bench_fun
54+ (" Path.Local.append"
55+ [@ params
56+ t
57+ = [ " left root" , (" ." , long_path)
58+ ; " right root" , (long_path, " ." )
59+ ; " short paths" , (short_path, short_path)
60+ ; " long paths" , (long_path, long_path)
61+ ]])
6162 =
6263 let x, y = t in
6364 let x = Path.Local. of_string x in
0 commit comments