@@ -8,56 +8,57 @@ let root = "."
8
8
let short_path = " a/b/c"
9
9
let long_path = List. init 20 ~f: (fun _ -> " foo-bar-baz" ) |> String. concat ~sep: " /"
10
10
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 ]])
17
14
=
18
15
fun () -> ignore (Fpath. is_root path)
19
16
;;
20
17
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
+ ]])
34
31
=
35
32
let t, from = t in
36
33
let t = Path. of_string t in
37
34
let from = Path. of_string from in
38
35
fun () -> ignore (Path. reach t ~from )
39
36
;;
40
37
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
+ ]])
48
47
=
49
48
let x, y = t in
50
49
let x = Path.Local. of_string x in
51
50
fun () -> ignore (Path.Local. relative x y)
52
51
;;
53
52
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
+ ]])
61
62
=
62
63
let x, y = t in
63
64
let x = Path.Local. of_string x in
0 commit comments