Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Libraries/ConnectMocks/MockBidirectionalAsyncStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import SwiftProtobuf
///
/// To return data over the stream, outputs can be specified using `init(outputs: ...)` or by
/// subclassing and overriding `results()`.
@available(iOS 13, *)
open class MockBidirectionalAsyncStream<
Input: SwiftProtobuf.Message,
Output: SwiftProtobuf.Message
Expand Down
1 change: 1 addition & 0 deletions Libraries/ConnectMocks/MockClientOnlyAsyncStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import SwiftProtobuf
///
/// To return data over the stream, outputs can be specified using `init(outputs: ...)` or by
/// subclassing and overriding `results()`.
@available(iOS 13, *)
open class MockClientOnlyAsyncStream<
Input: SwiftProtobuf.Message,
Output: SwiftProtobuf.Message
Expand Down
1 change: 1 addition & 0 deletions Libraries/ConnectMocks/MockServerOnlyAsyncStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import SwiftProtobuf
///
/// To return data over the stream, outputs can be specified using `init(outputs: ...)` or by
/// subclassing and overriding `results()`.
@available(iOS 13, *)
open class MockServerOnlyAsyncStream<
Input: SwiftProtobuf.Message,
Output: SwiftProtobuf.Message
Expand Down
3 changes: 1 addition & 2 deletions Plugins/ConnectMocksPlugin/ConnectMockGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ final class ConnectMockGenerator: Generator {
self.printLine("/// class, allowing for mocking RPC calls. Behavior can be customized")
self.printLine("/// either through the properties on this class or by")
self.printLine("/// subclassing the class and overriding its methods.")
self.printLine("@available(iOS 13, *)")
self.printLine(
"\(self.typeVisibility) class \(service.mockName(using: self.namer)): \(protocolName) {"
)
Expand All @@ -82,7 +83,6 @@ final class ConnectMockGenerator: Generator {
self.printLine(
"/// Mocked for async calls to `\(method.name(using: self.options))()`."
)
self.printLine("@available(iOS 13, *)")
self.printLine(
"""
\(self.propertyVisibility) var \(method.asyncAwaitMockPropertyName()) = \
Expand Down Expand Up @@ -144,7 +144,6 @@ final class ConnectMockGenerator: Generator {
private func printAsyncAwaitMethodMockImplementation(for method: MethodDescriptor) {
self.printLine()

self.printLine("@available(iOS 13, *)")
self.printLine(
"\(self.typeVisibility) "
+ method.asyncAwaitSignature(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ private typealias UnimplementedServiceClient = Grpc_Testing_UnimplementedService
/// Tests are based on https://github.com/bufbuild/connect-crosstest
///
/// Tests are written using async/await APIs.
@available(iOS 13, *)
final class AsyncAwaitCrosstests: XCTestCase {
private func executeTestWithClients(
function: Selector = #function,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import SwiftProtobuf
import XCTest

/// Test suite that validates the behavior of generated mock classes.
@available(iOS 13, *)
final class ConnectMocksTests: XCTestCase {
// MARK: - Unary

Expand Down
46 changes: 6 additions & 40 deletions Tests/ConnectLibraryTests/Generated/grpc/testing/test.mock.swift

Large diffs are not rendered by default.