Skip to content

Commit

Permalink
test: use run.sh helper for intf.t
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypopp committed Dec 5, 2024
1 parent 3b5393e commit d302c83
Showing 1 changed file with 31 additions and 21 deletions.
52 changes: 31 additions & 21 deletions ppx/test/intf.t
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@

$ echo "type ('a, 'b) either [@@deriving json]" | ../browser/ppx_deriving_json_js_test.exe -intf -
type ('a, 'b) either[@@deriving json]
include
$ echo "module type S = sig type ('a, 'b) either [@@deriving json] end" | ./run.sh
=== ppx output:native ===
module type S =
sig
[@@@ocaml.warning "-32"]
val either_of_json :
(Js.Json.t -> 'a) -> (Js.Json.t -> 'b) -> Js.Json.t -> ('a, 'b) either
val either_to_json :
('a -> Js.Json.t) -> ('b -> Js.Json.t) -> ('a, 'b) either -> Js.Json.t
end[@@ocaml.doc "@inline"][@@merlin.hide ]

$ echo "type ('a, 'b) either [@@deriving json]" | ../native/ppx_deriving_json_native_test.exe -intf -
type ('a, 'b) either[@@deriving json]
include
type ('a, 'b) either[@@deriving json]
include
sig
[@@@ocaml.warning "-32"]
val either_of_json :
(Yojson.Basic.t -> 'a) ->
(Yojson.Basic.t -> 'b) -> Yojson.Basic.t -> ('a, 'b) either
val either_to_json :
('a -> Yojson.Basic.t) ->
('b -> Yojson.Basic.t) -> ('a, 'b) either -> Yojson.Basic.t
end[@@ocaml.doc "@inline"][@@merlin.hide ]
end
=== ppx output:browser ===
module type S =
sig
[@@@ocaml.warning "-32"]
val either_of_json :
(Yojson.Basic.t -> 'a) ->
(Yojson.Basic.t -> 'b) -> Yojson.Basic.t -> ('a, 'b) either
val either_to_json :
('a -> Yojson.Basic.t) ->
('b -> Yojson.Basic.t) -> ('a, 'b) either -> Yojson.Basic.t
end[@@ocaml.doc "@inline"][@@merlin.hide ]
type ('a, 'b) either[@@deriving json]
include
sig
[@@@ocaml.warning "-32"]
val either_of_json :
(Js.Json.t -> 'a) ->
(Js.Json.t -> 'b) -> Js.Json.t -> ('a, 'b) either
val either_to_json :
('a -> Js.Json.t) ->
('b -> Js.Json.t) -> ('a, 'b) either -> Js.Json.t
end[@@ocaml.doc "@inline"][@@merlin.hide ]
end
=== stdout:native ===
=== stdout:js ===

0 comments on commit d302c83

Please sign in to comment.