Skip to content

Commit cd0da59

Browse files
committed
fix tests after #45
1 parent cfbf5ed commit cd0da59

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

ppx/test/ptype_open.t

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ We can use the `Ptyp_open` AST node:
44
> type x = (int * int) [@@deriving json]
55
> end
66
> type u = X.(x) [@@deriving json]
7-
> let () = print_endline (Ppx_deriving_json_runtime.to_string (u_to_json (1, 2)))
8-
> let () = assert (u_of_json (Ppx_deriving_json_runtime.of_string {|[1, 2]|}) = (1, 2))
7+
> let () = print_endline (Melange_json.to_string (u_to_json (1, 2)))
8+
> let () = assert (u_of_json (Melange_json.of_string {|[1, 2]|}) = (1, 2))
99
> ' | ./run.sh
1010
=== ppx output:native ===
1111
module X =
@@ -20,7 +20,7 @@ We can use the `Ptyp_open` AST node:
2020
match x with
2121
| `List (x_0::x_1::[]) -> ((int_of_json x_0), (int_of_json x_1))
2222
| _ ->
23-
Ppx_deriving_json_runtime.of_json_error ~json:x
23+
Melange_json.of_json_error ~json:x
2424
"expected a JSON array of length 2" : Yojson.Basic.t -> x)
2525
let _ = x_of_json
2626
[@@@ocaml.warning "-39-11-27"]
@@ -43,11 +43,8 @@ We can use the `Ptyp_open` AST node:
4343
let rec u_to_json = (fun x -> X.x_to_json x : u -> Yojson.Basic.t)
4444
let _ = u_to_json
4545
end[@@ocaml.doc "@inline"][@@merlin.hide ]
46-
let () =
47-
print_endline (Ppx_deriving_json_runtime.to_string (u_to_json (1, 2)))
48-
let () =
49-
assert
50-
((u_of_json (Ppx_deriving_json_runtime.of_string {|[1, 2]|})) = (1, 2))
46+
let () = print_endline (Melange_json.to_string (u_to_json (1, 2)))
47+
let () = assert ((u_of_json (Melange_json.of_string {|[1, 2]|})) = (1, 2))
5148
=== ppx output:browser ===
5249
module X =
5350
struct
@@ -67,7 +64,7 @@ We can use the `Ptyp_open` AST node:
6764
((int_of_json (Js.Array.unsafe_get es 0)),
6865
(int_of_json (Js.Array.unsafe_get es 1)))
6966
else
70-
Ppx_deriving_json_runtime.of_json_error ~json:x
67+
Melange_json.of_json_error ~json:x
7168
"expected a JSON array of length 2" : Js.Json.t -> x)
7269
let _ = x_of_json
7370
[@@@ocaml.warning "-39-11-27"]
@@ -91,11 +88,8 @@ We can use the `Ptyp_open` AST node:
9188
let rec u_to_json = (fun x -> X.x_to_json x : u -> Js.Json.t)
9289
let _ = u_to_json
9390
end[@@ocaml.doc "@inline"][@@merlin.hide ]
94-
let () =
95-
print_endline (Ppx_deriving_json_runtime.to_string (u_to_json (1, 2)))
96-
let () =
97-
assert
98-
((u_of_json (Ppx_deriving_json_runtime.of_string {|[1, 2]|})) = (1, 2))
91+
let () = print_endline (Melange_json.to_string (u_to_json (1, 2)))
92+
let () = assert ((u_of_json (Melange_json.of_string {|[1, 2]|})) = (1, 2))
9993
=== stdout:native ===
10094
[1,2]
10195
=== stdout:js ===

0 commit comments

Comments
 (0)