strings.utflen -> utf8.RuneCount, RuneCountInString

R=r
DELTA=94  (52 added, 33 deleted, 9 changed)
OCL=20547
CL=20552
This commit is contained in:
Russ Cox 2008-12-04 21:00:34 -08:00
parent 94a66489ed
commit 0d1cbaf225
5 changed files with 62 additions and 43 deletions

View file

@ -79,21 +79,3 @@ export func TestSplit(t *testing.T) {
}
}
// TODO: utflen shouldn't even be in strings.
type UtflenTest struct {
in string;
out int;
}
var utflentests = []UtflenTest {
UtflenTest{ abcd, 4 },
UtflenTest{ faces, 3 },
UtflenTest{ commas, 7 },
}
export func TestUtflen(t *testing.T) {
for i := 0; i < len(utflentests); i++ {
tt := utflentests[i];
if out := strings.utflen(tt.in); out != tt.out {
t.Errorf("utflen(%q) = %d, want %d", tt.in, out, tt.out);
}
}
}