Skip to content

Commit

Permalink
Merge pull request #201 from bobot/deriver_qualified_name
Browse files Browse the repository at this point in the history
Add regression tests for qualified type
  • Loading branch information
c-cube authored Dec 3, 2021
2 parents 3ee3c01 + fac2c39 commit 7787b6e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let gen ~loc ?(env = TypeGen.empty) lg =
match lg with
| Lident s ->
Option.value ~default:(name s |> A.evar) @@ TypeGen.find_opt s env
| Ldot (lg, s) -> A.(pexp_construct (Located.mk @@ Ldot (lg, name s)) None)
| Ldot (lg, s) -> A.(pexp_ident (Located.mk @@ Ldot (lg, name s)))
| Lapply (_, _) -> raise (Invalid_argument "gen received an Lapply")

let frequency ~loc l = [%expr QCheck.Gen.frequency [%e l]]
Expand Down
7 changes: 7 additions & 0 deletions test/ppx_deriving_qcheck/deriver/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
(test
(name test)
(modules test)
(libraries alcotest ppxlib ppx_deriving_qcheck qcheck)
(preprocess (pps ppxlib.metaquot)))

(test
(name test_qualified_names)
(modules test_qualified_names)
(libraries qcheck)
(preprocess (pps ppx_deriving_qcheck)))
7 changes: 7 additions & 0 deletions test/ppx_deriving_qcheck/deriver/test_qualified_names.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Q = struct
type t = int
[@@deriving qcheck]
end

type t = Q.t
[@@deriving qcheck]

0 comments on commit 7787b6e

Please sign in to comment.