• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

mbarbin / super-master-mind / 177

16 Dec 2025 02:27PM UTC coverage: 92.007% (-4.3%) from 96.355%
177

push

github

web-flow
Merge pull request #33 from mbarbin/json-opening

Use json format for opening-book

420 of 491 new or added lines in 28 files covered. (85.54%)

2 existing lines in 1 file now uncovered.

1013 of 1101 relevant lines covered (92.01%)

3368615.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/stdlib/super_master_mind_stdlib.ml
1
(*********************************************************************************)
2
(*  super-master-mind: A solver for the super master mind game                   *)
3
(*  SPDX-FileCopyrightText: 2021-2025 Mathieu Barbin <mathieu.barbin@gmail.com>  *)
4
(*  SPDX-License-Identifier: MIT                                                 *)
5
(*********************************************************************************)
6

7
module Code_error = Code_error
8
module Dyn = Dyn
9
module Json = Json
10
module Ordering = Ordering
11
module Source_code_position = Source_code_position
12

13
let print pp = Format.printf "%a@." Pp.to_fmt pp
154✔
14
let print_dyn dyn = print (Dyn.pp dyn)
154✔
15

16
let require cond =
17
  if not cond then Code_error.raise "Required condition does not hold." []
1✔
18
;;
19

20
let require_does_raise f =
21
  match f () with
12✔
22
  | _ -> Code_error.raise "Did not raise." []
1✔
23
  | exception e -> print_endline (Printexc.to_string e)
11✔
24
;;
25

26
module Array = struct
27
  include Stdlib.ArrayLabels
28

29
  let is_empty t = Array.length t = 0
1✔
30
  let create ~len a = Array.make len a
41,939,209✔
31

32
  let filter_mapi t ~f =
33
    t |> Array.to_seqi |> Seq.filter_map (fun (i, x) -> f i x) |> Array.of_seq
298,830✔
34
  ;;
35

NEW
36
  let fold t ~init ~f = fold_left t ~init ~f
×
37

38
  let foldi t ~init ~f =
39
    t |> Array.to_seqi |> Seq.fold_left (fun acc (i, e) -> f i acc e) init
40,320✔
40
  ;;
41

42
  let sort t ~compare = sort t ~cmp:compare
299,365✔
43
end
44

45
module Hashtbl = struct
46
  include MoreLabels.Hashtbl
47

48
  let set t ~key ~data = replace t ~key ~data
40,320✔
49
end
50

51
module In_channel = struct
52
  include Stdlib.In_channel
53

NEW
54
  let read_all file = with_open_bin file input_all
×
55
end
56

57
module List = struct
58
  include Stdlib.ListLabels
59

60
  let rec drop_while li ~f =
61
    match li with
16✔
62
    | x :: l when f x -> drop_while l ~f
12✔
63
    | rest -> rest
4✔
64
  ;;
65

66
  let iter t ~f = iter ~f t
25,482✔
67
  let fold t ~init ~f = fold_left t ~init ~f
274✔
68
end
69

70
module Option = struct
71
  include Stdlib.Option
72

73
  let bind x ~f = bind x f
357,041,221✔
74
  let iter t ~f = iter f t
114✔
75
  let some_if cond a = if cond then Some a else None
8✔
76
end
77

78
module Out_channel = struct
79
  include Stdlib.Out_channel
80

81
  let output_lines t lines =
82
    List.iter lines ~f:(fun line ->
3✔
83
      output_string t line;
6✔
84
      output_char t '\n')
6✔
85
  ;;
86

NEW
87
  let with_open_text t ~f = with_open_text t f
×
88
end
89

90
module Result = struct
91
  include Stdlib.Result
92

93
  let bind x ~f = bind x f
19,128✔
NEW
94
  let map_error t ~f = map_error f t
×
95
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc