@@ -92,6 +92,25 @@ include("gen/test/test_pb.jl")
9292 @test contains (generated, " export TestService_TestClientStreamRPC_Client" )
9393 @test contains (generated, " export TestService_TestBidirectionalStreamRPC_Client" )
9494 end
95+
96+ # Test that request/response type package_namespace is correctly applied when types
97+ # come from a different proto package. Previously this was broken because the code
98+ # checked rpc.package_namespace instead of rpc.request_type.package_namespace and
99+ # rpc.response_type.package_namespace.
100+ mktempdir () do tmpdir
101+ @test isnothing (protojl (" ext_service.proto" , joinpath (@__DIR__ , " proto" ), tmpdir))
102+ generated = read (joinpath (tmpdir, " ext_service" , " ext_service_pb.jl" ), String)
103+ # Request type from ext_types package must be prefixed with package namespace
104+ @test contains (generated, " ext_types.ExtRequest" )
105+ # Response type from ext_types package must be prefixed with package namespace
106+ @test contains (generated, " ext_types.ExtResponse" )
107+ # Full type parameter string with both namespaced types
108+ @test contains (generated, " gRPCClient.gRPCServiceClient{ext_types.ExtRequest, false, ext_types.ExtResponse, false}" )
109+ @test contains (generated, " gRPCClient.gRPCServiceClient{ext_types.ExtRequest, false, ext_types.ExtResponse, true}" )
110+ # Service client constructors are present
111+ @test contains (generated, " ExtService_ExtRPC_Client(" )
112+ @test contains (generated, " ExtService_ExtStreamRPC_Client(" )
113+ end
95114 end
96115
97116 @testset " @async varying request/response" begin
0 commit comments