Len() -> RuneLength()

master
Charles Iliya Krempeaux 2022-07-18 18:50:29 -07:00
parent ae00f4e838
commit 3cd00adfc5
4 changed files with 4 additions and 4 deletions

View File

@ -601,7 +601,7 @@ func TestReadRunes(t *testing.T) {
t.Errorf("\tACTUAL: %s", FormatBinary(actualRune))
continue TestLoop
}
if expected, actual := Len(test.Expected[runeNumber]), actualInt; expected != actual {
if expected, actual := RuneLength(test.Expected[runeNumber]), actualInt; expected != actual {
t.Errorf("For test #%d and rune #%d, expected %d, but actually got %d.", testNumber, runeNumber, expected, actual)
t.Errorf("\tEXPECTED: %s", FormatBinary(test.Expected[runeNumber]))
t.Errorf("\tACTUAL: %s", FormatBinary(actualRune))

View File

@ -585,7 +585,7 @@ func TestRuneReaders(t *testing.T) {
t.Errorf("\tACTUAL: %s", FormatBinary(actualRune))
continue TestLoop
}
if expected, actual := Len(test.Expected[runeNumber]), actualInt; expected != actual {
if expected, actual := RuneLength(test.Expected[runeNumber]), actualInt; expected != actual {
t.Errorf("For test #%d and rune #%d, expected %d, but actually got %d.", testNumber, runeNumber, expected, actual)
t.Errorf("\tEXPECTED: %s", FormatBinary(test.Expected[runeNumber]))
t.Errorf("\tACTUAL: %s", FormatBinary(actualRune))

View File

@ -585,7 +585,7 @@ func TestRuneScanners(t *testing.T) {
t.Errorf("\tACTUAL: %s", FormatBinary(actualRune))
continue TestLoop
}
if expected, actual := Len(test.Expected[runeNumber]), actualInt; expected != actual {
if expected, actual := RuneLength(test.Expected[runeNumber]), actualInt; expected != actual {
t.Errorf("For test #%d and rune #%d, expected %d, but actually got %d.", testNumber, runeNumber, expected, actual)
t.Errorf("\tEXPECTED: %s", FormatBinary(test.Expected[runeNumber]))
t.Errorf("\tACTUAL: %s", FormatBinary(actualRune))

View File

@ -73,7 +73,7 @@ func TestRuneWriter(t *testing.T) {
continue TestLoop
}
if expected, actual := n, utf8.Len(r); expected != actual {
if expected, actual := n, utf8.RuneLength(r); expected != actual {
t.Errorf("For test #%d and rune #%d, expected a certain number of bytes to be written, but actually wasn't.", testNumber, runeNumber)
for i, rr := range test.Runes {
t.Logf("\t[%d] %q (%d)", i, string(rr), rr)