MCPcopy Create free account
hub / github.com/bytebase/bytebase / TestValidatePhone

Function TestValidatePhone

backend/common/util_test.go:231–253  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

229}
230
231func TestValidatePhone(t *testing.T) {
232 tests := []struct {
233 phone string
234 want bool
235 }{
236 {
237 phone: "1234567890",
238 want: false,
239 },
240 {
241 phone: "+8615655556666",
242 want: true,
243 },
244 }
245
246 for _, test := range tests {
247 got := ValidatePhone(test.phone)
248 isValid := got == nil
249 if isValid != test.want {
250 t.Errorf("validatePhone %s, err %v", test.phone, got)
251 }
252 }
253}

Callers

nothing calls this directly

Calls 2

ValidatePhoneFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected