Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbin committed Aug 22, 2024
1 parent 6a32cdf commit fd9e8e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
14 changes: 9 additions & 5 deletions src/fingerboard_location.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
(* along with Fingerboard. If not, see <https://www.gnu.org/licenses/>. *)
(**********************************************************************************)

type t =
{ fingerboard_position : Fingerboard_position.t
; string_number : Roman_numeral.t
}
[@@deriving compare, equal, hash, sexp_of]
include struct
[@@@coverage off]

type t =
{ fingerboard_position : Fingerboard_position.t
; string_number : Roman_numeral.t
}
[@@deriving compare, equal, hash, sexp_of]
end
12 changes: 10 additions & 2 deletions src/frequency.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@
(* along with Fingerboard. If not, see <https://www.gnu.org/licenses/>. *)
(**********************************************************************************)

type t = float [@@deriving compare, equal, hash, sexp_of]
include struct
[@@@coverage off]

type t = float [@@deriving compare, equal, hash, sexp_of]
end

let check_exn f =
if Float.compare f 0. < 0 then raise_s [%sexp "Out of bounds", [%here], (f : float)]
;;

let of_float_exn f =
if Float.compare f 0. < 0 then raise_s [%sexp "Out of bounds", [%here], (f : float)];
check_exn f;
f
;;

Expand Down
6 changes: 5 additions & 1 deletion src/octave_designation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
(* along with Fingerboard. If not, see <https://www.gnu.org/licenses/>. *)
(**********************************************************************************)

type t = int [@@deriving compare, equal, hash, sexp_of]
include struct
[@@@coverage off]

type t = int [@@deriving compare, equal, hash, sexp_of]
end

0 comments on commit fd9e8e7

Please sign in to comment.