Skip to content

Commit

Permalink
Add tests for the argument orders from ppx_deriving.make
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Rebours <nathan.p.rebours@gmail.com>
  • Loading branch information
NathanReb committed Apr 26, 2024
1 parent a32928f commit 48440a4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src_test/make/test_deriving_make.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ end = struct
[@@deriving show]
end

(* This module is here to test that the ordering of the arguments
match the order of the record fields declarations. *)
module M2 : sig
type t =
{ first : int
; second : int
}

val make : first: int -> second: int -> t
end = struct
type t =
{ first : int
; second : int
}
[@@deriving make]
end

let test_no_main ctxt =
assert_equal ~printer:M.show_a
{ M.a1 = None; a2 = []; a3 = 42; a4s = 2, []; a5 = 1 }
Expand Down

0 comments on commit 48440a4

Please sign in to comment.