Skip to content

Commit

Permalink
chore: update tests (dune promote)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbin committed Jan 14, 2024
1 parent 94bd3e1 commit 8d438e1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/examples/build_server.ml.expected
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module BuildServer = struct
module Client = struct
open Pbrt_services

let make : (file_path, unary, empty, unary) Client.rpc =
let make_ : (file_path, unary, empty, unary) Client.rpc =
(Client.mk_rpc
~package:[]
~service_name:"BuildServer" ~rpc_name:"make"
Expand All @@ -134,7 +134,7 @@ module BuildServer = struct
module Server = struct
open Pbrt_services

let _rpc_make : (file_path,unary,empty,unary) Server.rpc =
let make_ : (file_path,unary,empty,unary) Server.rpc =
(Server.mk_rpc ~name:"make"
~req_mode:Server.Unary
~res_mode:Server.Unary
Expand All @@ -145,13 +145,13 @@ module BuildServer = struct
() : _ Server.rpc)

let make
~make
~make_:__handler__make_
() : _ Server.t =
{ Server.
service_name="BuildServer";
package=[];
handlers=[
(make _rpc_make);
(__handler__make_ make_);
];
}
end
Expand Down
8 changes: 6 additions & 2 deletions src/examples/build_server.mli.expected
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ module BuildServer : sig

module Client : sig

val make : (file_path, unary, empty, unary) Client.rpc
val make_ : (file_path, unary, empty, unary) Client.rpc
end

module Server : sig
(** Produce a server implementation from handlers *)
val make :
make:((file_path, unary, empty, unary) Server.rpc -> 'handler) ->
make_:((file_path, unary, empty, unary) Server.rpc -> 'handler) ->
unit -> 'handler Pbrt_services.Server.t

(** The individual server stubs are only exposed for advanced users. Casual users should prefer accessing them through {!make}. *)

val make_ : (file_path,unary,empty,unary) Server.rpc
end
end
24 changes: 12 additions & 12 deletions src/examples/calculator.ml.expected
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ module Calculator = struct
module Server = struct
open Pbrt_services

let _rpc_add : (add_req,unary,i32,unary) Server.rpc =
let add : (add_req,unary,i32,unary) Server.rpc =
(Server.mk_rpc ~name:"add"
~req_mode:Server.Unary
~res_mode:Server.Unary
Expand All @@ -373,7 +373,7 @@ module Calculator = struct
~decode_pb_req:decode_pb_add_req
() : _ Server.rpc)

let _rpc_add_all : (add_all_req,unary,i32,unary) Server.rpc =
let add_all : (add_all_req,unary,i32,unary) Server.rpc =
(Server.mk_rpc ~name:"add_all"
~req_mode:Server.Unary
~res_mode:Server.Unary
Expand All @@ -383,7 +383,7 @@ module Calculator = struct
~decode_pb_req:decode_pb_add_all_req
() : _ Server.rpc)

let _rpc_ping : (empty,unary,empty,unary) Server.rpc =
let ping : (empty,unary,empty,unary) Server.rpc =
(Server.mk_rpc ~name:"ping"
~req_mode:Server.Unary
~res_mode:Server.Unary
Expand All @@ -393,7 +393,7 @@ module Calculator = struct
~decode_pb_req:decode_pb_empty
() : _ Server.rpc)

let _rpc_get_pings : (empty,unary,i32,unary) Server.rpc =
let get_pings : (empty,unary,i32,unary) Server.rpc =
(Server.mk_rpc ~name:"get_pings"
~req_mode:Server.Unary
~res_mode:Server.Unary
Expand All @@ -404,19 +404,19 @@ module Calculator = struct
() : _ Server.rpc)

let make
~add
~add_all
~ping
~get_pings
~add:__handler__add
~add_all:__handler__add_all
~ping:__handler__ping
~get_pings:__handler__get_pings
() : _ Server.t =
{ Server.
service_name="Calculator";
package=[];
handlers=[
(add _rpc_add);
(add_all _rpc_add_all);
(ping _rpc_ping);
(get_pings _rpc_get_pings);
(__handler__add add);
(__handler__add_all add_all);
(__handler__ping ping);
(__handler__get_pings get_pings);
];
}
end
Expand Down
10 changes: 10 additions & 0 deletions src/examples/calculator.mli.expected
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,15 @@ module Calculator : sig
ping:((empty, unary, empty, unary) Server.rpc -> 'handler) ->
get_pings:((empty, unary, i32, unary) Server.rpc -> 'handler) ->
unit -> 'handler Pbrt_services.Server.t

(** The individual server stubs are only exposed for advanced users. Casual users should prefer accessing them through {!make}. *)

val add : (add_req,unary,i32,unary) Server.rpc

val add_all : (add_all_req,unary,i32,unary) Server.rpc

val ping : (empty,unary,empty,unary) Server.rpc

val get_pings : (empty,unary,i32,unary) Server.rpc
end
end
24 changes: 12 additions & 12 deletions src/examples/file_server.ml.expected
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ module FileServer = struct
module Server = struct
open Pbrt_services

let _rpc_touch_file : (file_path,unary,empty,unary) Server.rpc =
let touch_file : (file_path,unary,empty,unary) Server.rpc =
(Server.mk_rpc ~name:"touch_file"
~req_mode:Server.Unary
~res_mode:Server.Unary
Expand All @@ -405,7 +405,7 @@ module FileServer = struct
~decode_pb_req:decode_pb_file_path
() : _ Server.rpc)

let _rpc_upload_file : (file_chunk,stream,file_crc,unary) Server.rpc =
let upload_file : (file_chunk,stream,file_crc,unary) Server.rpc =
(Server.mk_rpc ~name:"upload_file"
~req_mode:Server.Stream
~res_mode:Server.Unary
Expand All @@ -415,7 +415,7 @@ module FileServer = struct
~decode_pb_req:decode_pb_file_chunk
() : _ Server.rpc)

let _rpc_download_file : (file_path,unary,file_chunk,stream) Server.rpc =
let download_file : (file_path,unary,file_chunk,stream) Server.rpc =
(Server.mk_rpc ~name:"download_file"
~req_mode:Server.Unary
~res_mode:Server.Stream
Expand All @@ -425,7 +425,7 @@ module FileServer = struct
~decode_pb_req:decode_pb_file_path
() : _ Server.rpc)

let _rpc_ping_pong : (ping,stream,pong,stream) Server.rpc =
let ping_pong : (ping,stream,pong,stream) Server.rpc =
(Server.mk_rpc ~name:"ping_pong"
~req_mode:Server.Stream
~res_mode:Server.Stream
Expand All @@ -436,19 +436,19 @@ module FileServer = struct
() : _ Server.rpc)

let make
~touch_file
~upload_file
~download_file
~ping_pong
~touch_file:__handler__touch_file
~upload_file:__handler__upload_file
~download_file:__handler__download_file
~ping_pong:__handler__ping_pong
() : _ Server.t =
{ Server.
service_name="FileServer";
package=[];
handlers=[
(touch_file _rpc_touch_file);
(upload_file _rpc_upload_file);
(download_file _rpc_download_file);
(ping_pong _rpc_ping_pong);
(__handler__touch_file touch_file);
(__handler__upload_file upload_file);
(__handler__download_file download_file);
(__handler__ping_pong ping_pong);
];
}
end
Expand Down
10 changes: 10 additions & 0 deletions src/examples/file_server.mli.expected
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,15 @@ module FileServer : sig
download_file:((file_path, unary, file_chunk, stream) Server.rpc -> 'handler) ->
ping_pong:((ping, stream, pong, stream) Server.rpc -> 'handler) ->
unit -> 'handler Pbrt_services.Server.t

(** The individual server stubs are only exposed for advanced users. Casual users should prefer accessing them through {!make}. *)

val touch_file : (file_path,unary,empty,unary) Server.rpc

val upload_file : (file_chunk,stream,file_crc,unary) Server.rpc

val download_file : (file_path,unary,file_chunk,stream) Server.rpc

val ping_pong : (ping,stream,pong,stream) Server.rpc
end
end

0 comments on commit 8d438e1

Please sign in to comment.