32 lines
995 B
Swift
32 lines
995 B
Swift
import Testing
|
|
@testable import SstCore
|
|
|
|
struct PromptEchoTests {
|
|
let vocabulary = ["Anthropic", "Vercel", "Supabase"]
|
|
|
|
@Test func firstTwoTermsAreAnEcho() {
|
|
#expect(PromptEcho.isEcho("Anthropic, Vercel.", vocabulary: vocabulary))
|
|
}
|
|
|
|
@Test func wholeListIsAnEcho() {
|
|
#expect(PromptEcho.isEcho("anthropic vercel supabase", vocabulary: vocabulary))
|
|
}
|
|
|
|
@Test func singleTermIsRealSpeech() {
|
|
#expect(!PromptEcho.isEcho("Anthropic", vocabulary: vocabulary))
|
|
}
|
|
|
|
@Test func termsOutOfOrderAreNotAnEcho() {
|
|
#expect(!PromptEcho.isEcho("Vercel, Anthropic", vocabulary: vocabulary))
|
|
}
|
|
|
|
@Test func sentenceContainingTermsIsNotAnEcho() {
|
|
#expect(!PromptEcho.isEcho("Ik gebruik Anthropic en Vercel", vocabulary: vocabulary))
|
|
}
|
|
|
|
@Test func tooShortVocabularyNeverEchoes() {
|
|
#expect(!PromptEcho.isEcho("Anthropic", vocabulary: ["Anthropic"]))
|
|
#expect(!PromptEcho.isEcho("", vocabulary: vocabulary))
|
|
}
|
|
}
|