Skip to content

Commit

Permalink
try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Nov 16, 2023
1 parent 63c99cf commit 90e44a5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
1 change: 0 additions & 1 deletion iter.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ depends: [
"ounit2" {with-test}
"mdx" {with-test & >= "1.3" }
"odoc" {with-doc}
"containers" {with-test}
]
tags: [ "iter" "iterator" "iter" "fold" ]
homepage: "https://github.com/c-cube/iter/"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

(tests
(names t_iter)
(libraries iter qcheck-core qcheck-core.runner ounit2 containers))
(libraries iter qcheck-core qcheck-core.runner ounit2))
29 changes: 19 additions & 10 deletions tests/unit/t_iter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,30 @@ let () =
OUnit.assert_equal 2 n;
()

let list_equal eq l1 l2 =
List.length l1 = List.length l2 && List.for_all2 eq l1 l2

let () =
OUnit.assert_equal
~cmp:(CCList.equal Int.equal)
OUnit.assert_equal ~cmp:(list_equal Int.equal)
(1 -- 10
|> map_while (fun x -> if x = 7 then `Return (x + 1) else `Yield (x - 1))
|> to_list)
[0; 1; 2; 3; 4; 5; 8]
|> map_while (fun x ->
if x = 7 then
`Return (x + 1)
else
`Yield (x - 1))
|> to_list)
[ 0; 1; 2; 3; 4; 5; 8 ]

let () =
OUnit.assert_equal
~cmp:(CCList.equal Int.equal)
OUnit.assert_equal ~cmp:(list_equal Int.equal)
(1 -- 10
|> map_while (fun x -> if x = 7 then `Stop else `Yield (x - 1))
|> to_list)
[0; 1; 2; 3; 4; 5]
|> map_while (fun x ->
if x = 7 then
`Stop
else
`Yield (x - 1))
|> to_list)
[ 0; 1; 2; 3; 4; 5 ]

let () = 1 -- 5 |> drop 2 |> to_list |> OUnit.assert_equal [ 3; 4; 5 ]
let () = 1 -- 5 |> rev |> to_list |> OUnit.assert_equal [ 5; 4; 3; 2; 1 ]
Expand Down

0 comments on commit 90e44a5

Please sign in to comment.