Skip to content

Commit c511fa6

Browse files
committed
Limit tests to iOS 15.0, macOS 11.0, macCatalyst 15.0
1 parent eb04563 commit c511fa6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Sources/GoogleAI/FunctionCalling.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,13 @@ extension CodeExecution: Encodable {}
353353

354354
extension ExecutableCode: Codable {}
355355

356+
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
356357
extension CodeExecutionResult.Outcome: Codable {
357358
public init(from decoder: any Decoder) throws {
358359
let value = try decoder.singleValueContainer().decode(String.self)
359360
guard let decodedOutcome = CodeExecutionResult.Outcome(rawValue: value) else {
360-
if #available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *) {
361-
Logging.default
362-
.error("[GoogleGenerativeAI] Unrecognized Outcome with value \"\(value)\".")
363-
}
361+
Logging.default
362+
.error("[GoogleGenerativeAI] Unrecognized Outcome with value \"\(value)\".")
364363
self = .unknown
365364
return
366365
}
@@ -369,6 +368,7 @@ extension CodeExecutionResult.Outcome: Codable {
369368
}
370369
}
371370

371+
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
372372
extension CodeExecutionResult: Codable {
373373
public init(from decoder: any Decoder) throws {
374374
let container = try decoder.container(keyedBy: CodingKeys.self)

Tests/GoogleAITests/CodeExecutionTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import XCTest
1616

1717
@testable import GoogleGenerativeAI
1818

19+
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
1920
final class CodeExecutionTests: XCTestCase {
2021
let decoder = JSONDecoder()
2122
let encoder = JSONEncoder()

0 commit comments

Comments
 (0)