File tree Expand file tree Collapse file tree 3 files changed +20
-12
lines changed Expand file tree Collapse file tree 3 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ depends: [
1717 "ounit2" {with-test}
1818 "mdx" {with-test & >= "1.3" }
1919 "odoc" {with-doc}
20- "containers" {with-test}
2120]
2221tags: [ "iter" "iterator" "iter" "fold" ]
2322homepage: "https://github.com/c-cube/iter/"
Original file line number Diff line number Diff line change 11
22(tests
33 (names t_iter)
4- (libraries iter qcheck-core qcheck-core.runner ounit2 containers ))
4+ (libraries iter qcheck-core qcheck-core.runner ounit2))
Original file line number Diff line number Diff line change @@ -237,21 +237,30 @@ let () =
237237 OUnit. assert_equal 2 n;
238238 ()
239239
240+ let list_equal eq l1 l2 =
241+ List. length l1 = List. length l2 && List. for_all2 eq l1 l2
242+
240243let () =
241- OUnit. assert_equal
242- ~cmp: (CCList. equal Int. equal)
244+ OUnit. assert_equal ~cmp: (list_equal Int. equal)
243245 (1 -- 10
244- |> map_while (fun x -> if x = 7 then `Return (x + 1 ) else `Yield (x - 1 ))
245- |> to_list)
246- [0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 8 ]
246+ |> map_while (fun x ->
247+ if x = 7 then
248+ `Return (x + 1 )
249+ else
250+ `Yield (x - 1 ))
251+ |> to_list)
252+ [ 0 ; 1 ; 2 ; 3 ; 4 ; 5 ; 8 ]
247253
248254let () =
249- OUnit. assert_equal
250- ~cmp: (CCList. equal Int. equal)
255+ OUnit. assert_equal ~cmp: (list_equal Int. equal)
251256 (1 -- 10
252- |> map_while (fun x -> if x = 7 then `Stop else `Yield (x - 1 ))
253- |> to_list)
254- [0 ; 1 ; 2 ; 3 ; 4 ; 5 ]
257+ |> map_while (fun x ->
258+ if x = 7 then
259+ `Stop
260+ else
261+ `Yield (x - 1 ))
262+ |> to_list)
263+ [ 0 ; 1 ; 2 ; 3 ; 4 ; 5 ]
255264
256265let () = 1 -- 5 |> drop 2 |> to_list |> OUnit. assert_equal [ 3 ; 4 ; 5 ]
257266let () = 1 -- 5 |> rev |> to_list |> OUnit. assert_equal [ 5 ; 4 ; 3 ; 2 ; 1 ]
You can’t perform that action at this time.
0 commit comments