• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbarbin / super-master-mind / 175

16 Dec 2025 01:06PM UTC coverage: 91.985% (-4.4%) from 96.355%
175

Pull #33

github

web-flow
Merge 4e9181239 into 9cd937d49
Pull Request #33: Use json format for opening-book

417 of 488 new or added lines in 28 files covered. (85.45%)

2 existing lines in 1 file now uncovered.

1010 of 1098 relevant lines covered (91.99%)

3376283.74 hits per line

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

84.0
/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,920,013✔
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,902✔
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,343✔
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 iter t ~f = iter ~f t
25,482✔
61
  let fold t ~init ~f = fold_left t ~init ~f
274✔
62
end
63

64
module Option = struct
65
  include Stdlib.Option
66

67
  let bind x ~f = bind x f
355,784,506✔
68
  let iter t ~f = iter f t
114✔
69
  let some_if cond a = if cond then Some a else None
8✔
70
end
71

72
module Out_channel = struct
73
  include Stdlib.Out_channel
74

75
  let output_lines t lines =
76
    List.iter lines ~f:(fun line ->
3✔
77
      output_string t line;
6✔
78
      output_char t '\n')
6✔
79
  ;;
80

NEW
81
  let with_open_text t ~f = with_open_text t f
×
82
end
83

84
module Result = struct
85
  include Stdlib.Result
86

87
  let bind x ~f = bind x f
19,128✔
NEW
88
  let map_error t ~f = map_error f t
×
89
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