diff --git a/ppx/native/dune b/ppx/native/dune index e124f83..6f0e2db 100644 --- a/ppx/native/dune +++ b/ppx/native/dune @@ -7,7 +7,7 @@ ppx_deriving_json_runtime ppx_deriving_json_native_test) (libraries ppxlib) - (ppx_runtime_libraries melange-json-native.ppx-runtime) + (ppx_runtime_libraries melange-json-native.ppx-runtime yojson) (preprocess (pps ppxlib.metaquot)) (kind ppx_deriver)) diff --git a/ppx/test/ppx_deriving_json_native.e2e.t b/ppx/test/ppx_deriving_json_native.e2e.t index 3eba65c..10ab746 100644 --- a/ppx/test/ppx_deriving_json_native.e2e.t +++ b/ppx/test/ppx_deriving_json_native.e2e.t @@ -16,15 +16,57 @@ > ' >> main.ml $ dune build ./main.exe - File "example.ml", line 1, characters 0-33: - 1 | type user = int [@@deriving json] - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Error: Unbound module Yojson - [1] $ dune exec ./main.exe - File "example.ml", line 1, characters 0-33: - 1 | type user = int [@@deriving json] - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Error: Unbound module Yojson - [1] + JSON DATA: 1 + JSON REPRINT: 1 + JSON DATA: "OK" + JSON REPRINT: "OK" + JSON DATA: "some" + JSON REPRINT: "some" + JSON DATA: ["Ok", 1] + JSON REPRINT: ["Ok",1] + JSON DATA: ["Error", "oops"] + JSON REPRINT: ["Error","oops"] + JSON DATA: [42, "works"] + JSON REPRINT: [42,"works"] + JSON DATA: {"name":"N","age":1} + JSON REPRINT: {"name":"N","age":1} + JSON DATA: ["A"] + JSON REPRINT: ["A"] + JSON DATA: ["B", 42] + JSON REPRINT: ["B",42] + JSON DATA: ["C", {"name": "cname"}] + JSON REPRINT: ["C",{"name":"cname"}] + JSON DATA: ["A"] + JSON REPRINT: ["A"] + JSON DATA: ["B", 42] + JSON REPRINT: ["B",42] + JSON DATA: ["Fix",["Fix",["Fix",["A"]]]] + JSON REPRINT: ["Fix",["Fix",["Fix",["A"]]]] + JSON DATA: ["Fix",["Fix",["Fix",["A"]]]] + JSON REPRINT: ["Fix",["Fix",["Fix",["A"]]]] + JSON DATA: "A" + JSON REPRINT: "A" + JSON DATA: "b_aliased" + JSON REPRINT: "b_aliased" + JSON DATA: "b" + JSON REPRINT: "b" + JSON DATA: "A_aliased" + JSON REPRINT: "A_aliased" + JSON DATA: {"my_name":"N","my_age":1} + JSON REPRINT: {"my_name":"N","my_age":1} + JSON DATA: {"my_name":"N"} + JSON REPRINT: {"my_name":"N","my_age":100} + JSON DATA: {} + JSON REPRINT: {"k":null} + JSON DATA: {"k":42} + JSON REPRINT: {"k":42} + JSON DATA: ["A",1] + JSON REPRINT: ["A",1] + JSON DATA: ["B","ok"] + JSON REPRINT: ["B","ok"] + JSON DATA: {"a":1,"b":2} + JSON REPRINT: {"a":1} + JSON DATA: ["A",{"a":1,"b":2}] + JSON REPRINT: ["A",{"a":1}]