Validate compiled Suno output
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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")))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user