fix: canonicalize phone numbers as E.164
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package tel
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPreCheckDefaultsToChina(t *testing.T) {
|
||||
got, err := (&validator{}).PreCheck("13800138000", map[string]any{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got != "tel:+8613800138000" {
|
||||
t.Fatalf("got %q, want tel:+8613800138000", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user