File: t_set.ml

package info (click to toggle)
ocaml-containers 3.15%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,412 kB
  • sloc: ml: 33,221; sh: 122; makefile: 32
file content (29 lines) | stat: -rw-r--r-- 632 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module T = (val Containers_testlib.make ~__FILE__ ())
include T

module S = CCSet.Make (struct
  type t = int

  let compare x y = Stdlib.compare x y
end)
;;

eq ~printer:(fun s -> s) (S.to_string string_of_int (S.of_list [ 4; 3 ])) "3,4"
;;

q
  Q.(list int)
  (fun l ->
    let s = S.of_list l in
    S.to_string string_of_int s
    = (CCList.sort_uniq ~cmp:CCInt.compare l
      |> List.map string_of_int |> String.concat ","))
;;

q
  Q.(list int)
  (fun l ->
    let s = S.of_list l in
    S.to_string ~sep:" " string_of_int s
    = (CCList.sort_uniq ~cmp:CCInt.compare l
      |> List.map string_of_int |> String.concat " "))