20 lines
768 B
Swift
20 lines
768 B
Swift
import MusicAssistantCore
|
|
import XCTest
|
|
|
|
final class SunoOutputValidationTests: XCTestCase {
|
|
func testValidatorRejectsOutputWithoutSunoContent() {
|
|
let output = CompiledSunoOutput(lyricsText: " \n ", stylePrompt: "\t")
|
|
|
|
XCTAssertThrowsError(try CompiledSunoOutputValidator().validate(output)) { error in
|
|
XCTAssertEqual(error as? SunoOutputValidationError, .missingContent)
|
|
}
|
|
}
|
|
|
|
func testValidatorAllowsLyricsOrAStylePrompt() throws {
|
|
let validator = CompiledSunoOutputValidator()
|
|
|
|
XCTAssertNoThrow(try validator.validate(CompiledSunoOutput(lyricsText: "Lyrics", stylePrompt: "")))
|
|
XCTAssertNoThrow(try validator.validate(CompiledSunoOutput(lyricsText: "", stylePrompt: "Cinematic folk")))
|
|
}
|
|
}
|