feat: controller supports vocabulary bias, prompt-echo guard, corrector and result hook
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user