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

mbarbin / super-master-mind / 216

31 Jan 2026 09:40AM UTC coverage: 75.947% (-12.4%) from 88.313%
216

Pull #45

github

web-flow
Merge 729c30d79 into 3d48eb3d9
Pull Request #45: Dune pkg ci migration

922 of 1214 relevant lines covered (75.95%)

2008918.11 hits per line

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

16.67
/src/stdlib/json.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
type t = Yojson.Basic.t
8

9
exception Invalid_json of string * t
10
exception Parse_error of string
11

12
let load ~file =
13
  try Yojson.Basic.from_file file with
3✔
14
  | Yojson.Json_error msg -> raise (Parse_error msg)
×
15
;;
16

17
let save t ~file =
18
  Out_channel.with_open_text file (fun oc ->
×
19
    Yojson.Basic.pretty_to_channel ~std:true oc t;
×
20
    Out_channel.output_char oc '\n')
×
21
;;
22

23
let to_string t = Yojson.Basic.pretty_to_string ~std:true t
×
24

25
let of_string s =
26
  try Yojson.Basic.from_string s with
×
27
  | Yojson.Json_error msg -> raise (Parse_error msg)
×
28
;;
29

30
let () =
31
  Printexc.register_printer (function
12✔
32
    | Invalid_json (msg, json) ->
×
33
      Some (Printf.sprintf "Json.Invalid_json(%S, %s)" msg (Yojson.Basic.to_string json))
×
34
    | Parse_error msg -> Some (Printf.sprintf "Json.Parse_error(%S)" msg)
×
35
    | _ -> None [@coverage off])
36
;;
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

© 2026 Coveralls, Inc