Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
Signed-off-by: Luke Maurer <[email protected]>
  • Loading branch information
lukemaurer committed Jan 31, 2025
1 parent 41b8f8f commit 2d98e61
Show file tree
Hide file tree
Showing 15 changed files with 458 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test-dirs/parameters.t/basic.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type t = P.t

let create = P.create
let wrap t = t
let p t = t
let to_string t = "Basic(" ^ P.to_string t ^ ")"
15 changes: 15 additions & 0 deletions tests/test-dirs/parameters.t/basic.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(** Basic functionality implemented over the [P] parameter. *)

(** A [P.t] with minor enhancements. *)
type t

(** Make a [t] from scratch. *)
val create : unit -> t

(** Make a [t] from a [P.t]. *)
val wrap : P.t -> t

val p : t -> P.t

(** Convert [t] to string. *)
val to_string : t -> string
5 changes: 5 additions & 0 deletions tests/test-dirs/parameters.t/fancy.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type t = Basic.t

let create t = t
let wrap t = Basic.wrap t
let to_string t = "Fancy(" ^ Basic.to_string t ^ ")"
6 changes: 6 additions & 0 deletions tests/test-dirs/parameters.t/fancy.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type t

(** Make something fancy out of something basic. *)
val create : Basic.t -> t
val wrap : P.t -> t
val to_string : t -> string
13 changes: 13 additions & 0 deletions tests/test-dirs/parameters.t/p.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(** A parameter module. *)

(** A thing. *)
type t

(** Make a thing. *)
val create : unit -> t

(** Frobnicate the thing. *)
val frob : t -> t

(** Show the thing. *)
val to_string : t -> string
5 changes: 5 additions & 0 deletions tests/test-dirs/parameters.t/p_int.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type t = int

let create () = 0
let frob = succ
let to_string = string_of_int
5 changes: 5 additions & 0 deletions tests/test-dirs/parameters.t/p_int.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type t = int

val create : unit -> t
val frob : t -> t
val to_string : t -> string
6 changes: 6 additions & 0 deletions tests/test-dirs/parameters.t/reexport.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(** An alias to the parameter [P] *)
module As_alias = P

module Included = struct
include P
end
8 changes: 8 additions & 0 deletions tests/test-dirs/parameters.t/reexport.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(** An alias to the parameter [P] *)
module As_alias = P

module Included : sig
include module type of struct
include P
end
end
Loading

0 comments on commit 2d98e61

Please sign in to comment.