|
|
@@ -61,8 +61,7 @@ struct ProtobufCodeGenParserTests {
|
|
|
@Test("Dependencies")
|
|
|
func dependencies() {
|
|
|
let expected: [GRPCCodeGen.Dependency] = [
|
|
|
- .init(module: "GRPCProtobuf", accessLevel: .internal), // Always an internal import
|
|
|
- .init(module: "SwiftProtobuf", accessLevel: .internal),
|
|
|
+ .init(module: "GRPCProtobuf", accessLevel: .internal) // Always an internal import
|
|
|
]
|
|
|
#expect(self.codeGen.dependencies == expected)
|
|
|
}
|
|
|
@@ -174,8 +173,7 @@ struct ProtobufCodeGenParserTests {
|
|
|
@Test("Dependencies")
|
|
|
func dependencies() {
|
|
|
let expected: [GRPCCodeGen.Dependency] = [
|
|
|
- .init(module: "GRPCProtobuf", accessLevel: .internal), // Always an internal import
|
|
|
- .init(module: "SwiftProtobuf", accessLevel: .internal),
|
|
|
+ .init(module: "GRPCProtobuf", accessLevel: .internal) // Always an internal import
|
|
|
]
|
|
|
#expect(self.codeGen.dependencies == expected)
|
|
|
}
|
|
|
@@ -237,4 +235,26 @@ struct ProtobufCodeGenParserTests {
|
|
|
#expect(self.service.namespace.base == "")
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Suite("Service using 'well-known types' (wkt-service.proto)")
|
|
|
+ struct WKTService: UsesDescriptorSet {
|
|
|
+ static let descriptorSetName = "wkt-service"
|
|
|
+ static let fileDescriptorName = "wkt-service"
|
|
|
+
|
|
|
+ let codeGen: CodeGenerationRequest
|
|
|
+
|
|
|
+ init() throws {
|
|
|
+ let descriptor = try #require(try Self.fileDescriptor)
|
|
|
+ self.codeGen = try parseDescriptor(descriptor)
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test("Dependencies")
|
|
|
+ func dependencies() {
|
|
|
+ let expected: [Dependency] = [
|
|
|
+ Dependency(module: "GRPCProtobuf", accessLevel: .internal),
|
|
|
+ Dependency(module: "SwiftProtobuf", accessLevel: .internal),
|
|
|
+ ]
|
|
|
+ #expect(self.codeGen.dependencies == expected)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|