diff options
author | Russ Cox <rsc@golang.org> | 2009-06-29 15:24:23 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-06-29 15:24:23 -0700 |
commit | 755e009ad2a874373454d488f9ea46648a8a9547 (patch) | |
tree | ed3d700304a76b08cdca0f356605077c58ee0f76 /src/pkg/bytes/bytes_test.go | |
parent | 24323437280c7f0a166b7f2fae75620470cde0f9 (diff) | |
download | golang-755e009ad2a874373454d488f9ea46648a8a9547.tar.gz |
io.StringBytes -> strings.Bytes
io.ByteBuffer -> bytes.Buffer
left io.ByteBuffer stub around for now,
for protocol compiler.
R=r
OCL=30861
CL=30872
Diffstat (limited to 'src/pkg/bytes/bytes_test.go')
-rw-r--r-- | src/pkg/bytes/bytes_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pkg/bytes/bytes_test.go b/src/pkg/bytes/bytes_test.go index 01adbccfd..a3e44262c 100644 --- a/src/pkg/bytes/bytes_test.go +++ b/src/pkg/bytes/bytes_test.go @@ -6,7 +6,7 @@ package bytes import ( "bytes"; - "io"; + "strings"; "testing"; ) @@ -59,8 +59,8 @@ var comparetests = []CompareTest { func TestCompare(t *testing.T) { for i := 0; i < len(comparetests); i++ { tt := comparetests[i]; - a := io.StringBytes(tt.a); - b := io.StringBytes(tt.b); + a := strings.Bytes(tt.a); + b := strings.Bytes(tt.b); cmp := Compare(a, b); eql := Equal(a, b); if cmp != tt.cmp { @@ -85,7 +85,7 @@ var explodetests = []ExplodeTest { } func TestExplode(t *testing.T) { for _, tt := range(explodetests) { - a := explode(io.StringBytes(tt.s), tt.n); + a := explode(strings.Bytes(tt.s), tt.n); result := arrayOfString(a); if !eq(result, tt.a) { t.Errorf(`Explode("%s", %d) = %v; want %v`, tt.s, tt.n, result, tt.a); @@ -122,13 +122,13 @@ var splittests = []SplitTest { } func TestSplit(t *testing.T) { for _, tt := range splittests { - a := Split(io.StringBytes(tt.s), io.StringBytes(tt.sep), tt.n); + a := Split(strings.Bytes(tt.s), strings.Bytes(tt.sep), tt.n); result := arrayOfString(a); if !eq(result, tt.a) { t.Errorf(`Split(%q, %q, %d) = %v; want %v`, tt.s, tt.sep, tt.n, result, tt.a); continue; } - s := Join(a, io.StringBytes(tt.sep)); + s := Join(a, strings.Bytes(tt.sep)); if string(s) != tt.s { t.Errorf(`Join(Split(%q, %q, %d), %q) = %q`, tt.s, tt.sep, tt.n, tt.sep, s); } @@ -154,8 +154,8 @@ var copytests = []CopyTest { func TestCopy(t *testing.T) { for i := 0; i < len(copytests); i++ { tt := copytests[i]; - dst := io.StringBytes(tt.a); - n := Copy(dst, io.StringBytes(tt.b)); + dst := strings.Bytes(tt.a); + n := Copy(dst, strings.Bytes(tt.b)); result := string(dst); if result != tt.res || n != tt.n { t.Errorf(`Copy(%q, %q) = %d, %q; want %d, %q`, tt.a, tt.b, n, result, tt.n, tt.res); |