Skip to content

Commit

Permalink
Update OpenAITests.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
kalafus authored Feb 7, 2024
1 parent 3a1a171 commit 71c142a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/OpenAITests/OpenAITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,25 +259,25 @@ class OpenAITests: XCTestCase {
}

func testAudioSpeechDoesNotNormalize() async throws {
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, responseFormat: .mp3, speed: 2.0)
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, response_format: .mp3, speed: 2.0)

XCTAssertEqual(query.speed, "\(2.0)")
}

func testAudioSpeechNormalizeNil() async throws {
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, responseFormat: .mp3, speed: nil)
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, response_format: .mp3, speed: nil)

XCTAssertEqual(query.speed, "\(1.0)")
}

func testAudioSpeechNormalizeLow() async throws {
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, responseFormat: .mp3, speed: 0.0)
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, response_format: .mp3, speed: 0.0)

XCTAssertEqual(query.speed, "\(0.25)")
}

func testAudioSpeechNormalizeHigh() async throws {
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, responseFormat: .mp3, speed: 10.0)
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, response_format: .mp3, speed: 10.0)

XCTAssertEqual(query.speed, "\(4.0)")
}
Expand Down

0 comments on commit 71c142a

Please sign in to comment.