I keep getting the
An error occurred while running your tests. This might mean that there was an issue in our infrastructure, or it might mean that you have something in your code that’s causing our systems to break.
Please check your code, and if nothing seems to be wrong, try running the tests again.
error, even though my code works perfectly fine in XCode
Could someone tell me what could be the problem here?
let birthday = "Birthday"
let valentine = "Valentine's Day"
let anniversary = "Anniversary"
let space: Character = " "
let exclamation: Character = "!"
func buildSign(for occasion: String, name: String) -> String {
let signDone = "Happy " + occasion + String(space) + name + String(exclamation)
return signDone
}
let birthdaySign = buildSign(for: birthday, name: "Tyoma")
let valentineSign = buildSign(for: valentine, name: "Meow")
let anniversarySign = buildSign(for: anniversary, name: "Tyoma & Katia")
func graduationFor(name: String, year: Int) -> String {
let graduationGreeting = "Congratulations, \(name)\(exclamation) Class of \(year)"
return graduationGreeting
}
let graduationGreeting = graduationFor(name: "Katia", year: 2021)
func costOf(sign: String) -> Int {
let signCount = sign.count
return 20 + (signCount * 2)
}
var countCost = costOf(sign: "Happy Birthday Grandma!")