From 0049b3a26a18dd8c03d85036244a0f3b592c415c Mon Sep 17 00:00:00 2001 From: Cristian A Monterroza Date: Tue, 5 Aug 2025 02:20:30 -0700 Subject: [PATCH] test: use Swift Testing in Linux environment test --- LinuxDummyTests/LinuxDummyTests.swift | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/LinuxDummyTests/LinuxDummyTests.swift b/LinuxDummyTests/LinuxDummyTests.swift index 394626c..8415c8f 100644 --- a/LinuxDummyTests/LinuxDummyTests.swift +++ b/LinuxDummyTests/LinuxDummyTests.swift @@ -1,8 +1,22 @@ -import XCTest +#if os(Linux) +import Testing @testable import GoogleGenerativeAI -final class LinuxDummyTests: XCTestCase { - func testExample() { - XCTAssertTrue(true) +@Suite("Environment Configuration") +struct EnvironmentConfigurationTests { + @Test("default headers and configuration") + func environmentConfiguration() { + let env = AI.GoogleGenAI.Environment(apiKey: "test-key") + let headers = env.headers + + #expect(env.baseURLString == "generativelanguage.googleapis.com") + #expect(env.apiVersion == "v1beta") + #expect(headers["x-goog-api-key"] == "test-key") + #expect( + headers["x-goog-api-client"] == + "genai-swift/\(String(describing: env.clientVersion))" + ) + #expect(headers["Content-Type"] == "application/json") } } +#endif