mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
strings.utflen -> utf8.RuneCount, RuneCountInString
R=r DELTA=94 (52 added, 33 deleted, 9 changed) OCL=20547 CL=20552
This commit is contained in:
parent
94a66489ed
commit
0d1cbaf225
5 changed files with 62 additions and 43 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue