@@ -65,12 +65,18 @@ defmodule GrpcReflection.V1alphaReflectionTest do
6565 assert { :error , _ } = run_request ( message , ctx )
6666 end
6767
68- test "describing a type returns the type" , ctx do
68+ test "describing a root type returns the type" , ctx do
6969 message = { :file_containing_symbol , "helloworld.HelloRequest" }
7070 assert { :ok , response } = run_request ( message , ctx )
7171 assert_response ( response )
7272 end
7373
74+ test "describing a nested type returns the root type" , ctx do
75+ message = { :file_containing_symbol , "testserviceV3.TestRequest.Payload" }
76+ assert { :ok , response } = run_request ( message , ctx )
77+ assert response . name == "testserviceV3.TestRequest.proto"
78+ end
79+
7480 test "type with leading period still resolves" , ctx do
7581 message = { :file_containing_symbol , ".helloworld.HelloRequest" }
7682 assert { :ok , response } = run_request ( message , ctx )
@@ -173,7 +179,7 @@ defmodule GrpcReflection.V1alphaReflectionTest do
173179 ]
174180 end
175181
176- test "ensure inclusion of nested types in file descriptor dependencies" , ctx do
182+ test "ensure exclusion of nested types in file descriptor dependencies" , ctx do
177183 filename = "testserviceV3.TestRequest.proto"
178184 message = { :file_by_filename , filename }
179185 assert { :ok , response } = run_request ( message , ctx )
@@ -182,11 +188,8 @@ defmodule GrpcReflection.V1alphaReflectionTest do
182188
183189 assert response . dependency == [
184190 "testserviceV3.Enum.proto" ,
185- "testserviceV3.TestRequest.GEntry.proto" ,
186191 "google.protobuf.Any.proto" ,
187- "testserviceV3.TestRequest.Payload.proto" ,
188- "google.protobuf.StringValue.proto" ,
189- "testserviceV3.TestRequest.Payload.Location.proto"
192+ "google.protobuf.StringValue.proto"
190193 ]
191194 end
192195 end
0 commit comments