Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
20 lines
667 B
Go
20 lines
667 B
Go
package store
|
|
|
|
import "testing"
|
|
|
|
func TestNormalizeContactPhone(t *testing.T) {
|
|
for _, tc := range []struct{ input, want string }{
|
|
{"", ""}, {" 03-1234-5678 ", "0312345678"}, {"+81 (90) 1234-5678", "+819012345678"},
|
|
} {
|
|
_, got, err := NormalizeContactPhone(tc.input)
|
|
if err != nil || got != tc.want {
|
|
t.Fatalf("%q: %q %v", tc.input, got, err)
|
|
}
|
|
}
|
|
for _, input := range []string{"*21*123#", "tel:1234", "javascript:alert(1)", "123;ext=4", "123,456", "123\r\n456", "\t123", "123", "12+34", "+", "12", "1234567890123456", "(+)123", "123\x1b"} {
|
|
if _, _, err := NormalizeContactPhone(input); err == nil {
|
|
t.Errorf("accepted %q", input)
|
|
}
|
|
}
|
|
}
|