mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev https://golang.org/cl/224062
This commit is contained in:
parent
dfaa6eaa76
commit
9750adbbad
65 changed files with 239 additions and 310 deletions
|
|
@ -444,16 +444,16 @@ var RunesTests = []RunesTest{
|
|||
|
||||
func TestRunes(t *testing.T) {
|
||||
for _, tt := range RunesTests {
|
||||
a := Runes(tt.in)
|
||||
a := []int(tt.in)
|
||||
if !runesEqual(a, tt.out) {
|
||||
t.Errorf("Runes(%q) = %v; want %v", tt.in, a, tt.out)
|
||||
t.Errorf("[]int(%q) = %v; want %v", tt.in, a, tt.out)
|
||||
continue
|
||||
}
|
||||
if !tt.lossy {
|
||||
// can only test reassembly if we didn't lose information
|
||||
s := string(a)
|
||||
if s != tt.in {
|
||||
t.Errorf("string(Runes(%q)) = %x; want %x", tt.in, s, tt.in)
|
||||
t.Errorf("string([]int(%q)) = %x; want %x", tt.in, s, tt.in)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue