native macOS codings agent orchestrator prowl.onev.cat
Something went wrong. Try again.
Swift
123456789101112131415161718192021222324252627282930313233343536373839404142import Foundationimport Testing
@testable import Prowl
struct NotificationSoundTests { @Test func sourceMapsEachCaseToExactlyOneKind() { #expect(NotificationSound.never.source == nil) #expect(NotificationSound.funk.source == .system(name: "Funk")) #expect(NotificationSound.tink.source == .system(name: "Tink")) #expect(NotificationSound.prowlClassic.source == .bundled(resource: "notification", withExtension: "wav")) }
@Test func displayNamesAreUnambiguous() { #expect(NotificationSound.never.displayName == "Never") #expect(NotificationSound.prowlClassic.displayName == "Prowl Classic") #expect(NotificationSound.funk.displayName == "Funk") }
@Test func pickerGroupsCoverEveryCaseWithoutOverlap() { let grouped = [NotificationSound.never] + NotificationSound.systemCases + [.prowlClassic] #expect(Set(grouped) == Set(NotificationSound.allCases)) #expect(grouped.count == NotificationSound.allCases.count) }
// The raw values are the persisted contract; a rename orphans saved // selections, so pin the literals here. Change them only as a deliberate edit. @Test func rawValueContractIsStable() throws { #expect(NotificationSound.never.rawValue == "never") #expect(NotificationSound.hero.rawValue == "hero") #expect(NotificationSound.prowlClassic.rawValue == "supacodeClassic") #expect( Set(NotificationSound.allCases.map(\.rawValue)) == [ "never", "basso", "blow", "bottle", "frog", "funk", "glass", "hero", "morse", "ping", "pop", "purr", "sosumi", "submarine", "tink", "supacodeClassic", ] ) // The persisted JSON string must still decode to the case. #expect(try JSONDecoder().decode(NotificationSound.self, from: Data("\"hero\"".utf8)) == .hero) }}