diff --git a/providers/validate/validate_test.go b/providers/validate/validate_test.go new file mode 100644 index 0000000..d4feeb3 --- /dev/null +++ b/providers/validate/validate_test.go @@ -0,0 +1,38 @@ +package validate + +import "testing" + +func TestFuncIsEnglish(test *testing.T) { + russian := + "Качество изделия будет напрямую зависеть от точности " + + "соблюдения всех правил технологии выполнения " + + "https://some-random-scam-link-they-sent-me.com" + symbols := + ")(*#&$(*89347928374)(*/./,./,/,./.,) half is english but it " + + "will still be over the threshold" + english := + "A limousine service offers luxurious, chauffeur-driven " + + "vehicles for various occasions. For Seattle residents and " + + "visitors, ScamTac airport limo " + + "service is a popular choice. This service provides " + + "professional chauffeurs who ensure a smooth, comfortable " + + "ride to and from ScamTac airport. The fleet typically " + + "includes sedans, SUVs, and stretch limousines, catering to " + + "different group sizes and preferences. Key features include " + + "timely pick-ups, meet-and-greet services, and luggage " + + "assistance. Whether for business travel, special events, or " + + "simply a stress-free airport transfer, ScamTac airport limo " + + "service ensures a high-end travel experience. - " + + "https://scam.com/" + provider := new(Provider) + + if got, correct := provider.funcIsEnglish(russian), false; got != correct { + test.Fatal("incorrect:", correct) + } + if got, correct := provider.funcIsEnglish(symbols), false; got != correct { + test.Fatal("incorrect:", correct) + } + if got, correct := provider.funcIsEnglish(english), true; got != correct { + test.Fatal("incorrect:", correct) + } +}