Use compose.dev.yaml and compose.prod.yaml with fixed Go cache mounts, block sudo make dev, build Air outside app/tmp for rootless Docker, soften English spam checks, and simplify contact error copy. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
935 B
Go
30 lines
935 B
Go
package contactcheck
|
|
|
|
import "testing"
|
|
|
|
func TestValidateEnglish_acceptsPlainEnglish(t *testing.T) {
|
|
if err := ValidateEnglish("Jimmy", "Hello, I need help with an LED install."); err != nil {
|
|
t.Fatalf("unexpected error: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestValidateEnglish_acceptsTechnicalEnglish(t *testing.T) {
|
|
msg := "Need a quote for 50m WS2812 strip + ESP32 controller in Auckland."
|
|
if err := ValidateEnglish("Alex", msg); err != nil {
|
|
t.Fatalf("unexpected error: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestValidateEnglish_rejectsNonLatinScript(t *testing.T) {
|
|
msg := "これは日本語のテストメッセージです。十分な長さがあります。"
|
|
if err := ValidateEnglish("Jimmy", msg); err != ErrNotEnglish {
|
|
t.Fatalf("got %v, want ErrNotEnglish", err)
|
|
}
|
|
}
|
|
|
|
func TestValidateEnglish_rejectsTooShort(t *testing.T) {
|
|
if err := ValidateEnglish("Jimmy", "Hi there"); err != ErrTooShort {
|
|
t.Fatalf("got %v, want ErrTooShort", err)
|
|
}
|
|
}
|