Skip to content

Commit 2e27600

Browse files
committed
format
1 parent 53b3f75 commit 2e27600

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

tests/core/t_list.ml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,25 @@ eq
122122
(6, [ "1"; "a1"; "2"; "a2"; "3"; "a3" ])
123123
(let pf = Printf.sprintf in
124124
fold_flat_map (fun acc x -> acc + x, [ pf "%d" x; pf "a%d" x ]) 0 [ 1; 2; 3 ])
125-
;;
126125

127126
[@@@ifge 4.12]
128-
t @@ fun () ->
129-
let r = Atomic.make 0 in
130-
let f x =
131-
let n = Atomic.fetch_and_add r 1 in
132-
[ n, x ]
133-
in
134127

135-
let l = CCList.flat_map f [ "a"; "b"; "c" ] in
136-
assert_equal
137-
~printer:Q.Print.(list @@ pair int string)
138-
[ 0, "a"; 1, "b"; 2, "c" ]
139-
l;
140-
true
141-
;;
128+
let () =
129+
t @@ fun () ->
130+
let r = Atomic.make 0 in
131+
let f x =
132+
let n = Atomic.fetch_and_add r 1 in
133+
[ n, x ]
134+
in
135+
136+
let l = CCList.flat_map f [ "a"; "b"; "c" ] in
137+
assert_equal
138+
~printer:Q.Print.(list @@ pair int string)
139+
[ 0, "a"; 1, "b"; 2, "c" ]
140+
l;
141+
true
142142

143-
[@@@endif]
143+
[@@@endif];;
144144

145145
q
146146
Q.(list int)
@@ -219,11 +219,9 @@ t @@ fun () ->
219219
flat_map (fun x -> [ x + 1; x * 2 ]) [ 10; 100 ] = [ 11; 20; 101; 200 ]
220220
;;
221221

222-
223222
t @@ fun () -> List.length (flat_map (fun x -> [ x ]) (1 -- 300_000)) = 300_000
224223
;;
225-
t @@ fun () ->
226-
List.length (flat_map (fun _ -> 1 -- 300_000) (1 -- 2)) = 600_000
224+
t @@ fun () -> List.length (flat_map (fun _ -> 1 -- 300_000) (1 -- 2)) = 600_000
227225
;;
228226

229227
eq [ 1; 2; 2; 3; 3; 3 ]

0 commit comments

Comments
 (0)