summaryrefslogtreecommitdiff
path: root/src/pkg/bufio
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-06-29 15:24:23 -0700
committerRuss Cox <rsc@golang.org>2009-06-29 15:24:23 -0700
commit755e009ad2a874373454d488f9ea46648a8a9547 (patch)
treeed3d700304a76b08cdca0f356605077c58ee0f76 /src/pkg/bufio
parent24323437280c7f0a166b7f2fae75620470cde0f9 (diff)
downloadgolang-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/bufio')
-rw-r--r--src/pkg/bufio/bufio_test.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/pkg/bufio/bufio_test.go b/src/pkg/bufio/bufio_test.go
index dfb9e3ac8..9aab26729 100644
--- a/src/pkg/bufio/bufio_test.go
+++ b/src/pkg/bufio/bufio_test.go
@@ -5,10 +5,12 @@
package bufio
import (
+ "bytes";
"bufio";
"fmt";
"io";
"os";
+ "strings";
"testing";
"testing/iotest";
)
@@ -59,7 +61,7 @@ func readBytes(buf *Reader) string {
}
func TestReaderSimple(t *testing.T) {
- data := io.StringBytes("hello world");
+ data := strings.Bytes("hello world");
b := NewReader(io.NewByteReader(data));
if s := readBytes(b); s != "hello world" {
t.Errorf("simple hello world test failed: got %q", s);
@@ -146,7 +148,7 @@ func TestReader(t *testing.T) {
for h := 0; h < len(texts); h++ {
text := texts[h];
- textbytes := io.StringBytes(text);
+ textbytes := strings.Bytes(text);
for i := 0; i < len(readMakers); i++ {
for j := 0; j < len(bufreaders); j++ {
for k := 0; k < len(bufsizes); k++ {
@@ -172,7 +174,7 @@ func TestWriter(t *testing.T) {
for i := 0; i < len(data); i++ {
data[i] = byte(' '+ i%('~'-' '));
}
- w := new(io.ByteBuffer);
+ w := new(bytes.Buffer);
for i := 0; i < len(bufsizes); i++ {
for j := 0; j < len(bufsizes); j++ {
nwrite := bufsizes[i];
@@ -237,7 +239,7 @@ var errorWriterTests = []errorWriterTest {
func TestWriteErrors(t *testing.T) {
for i, w := range errorWriterTests {
buf := NewWriter(w);
- n, e := buf.Write(io.StringBytes("hello world"));
+ n, e := buf.Write(strings.Bytes("hello world"));
if e != nil {
t.Errorf("Write hello to %v: %v", w, e);
continue;
@@ -251,7 +253,7 @@ func TestWriteErrors(t *testing.T) {
func TestNewReaderSizeIdempotent(t *testing.T) {
const BufSize = 1000;
- b, err := NewReaderSize(io.NewByteReader(io.StringBytes("hello world")), BufSize);
+ b, err := NewReaderSize(io.NewByteReader(strings.Bytes("hello world")), BufSize);
if err != nil {
t.Error("NewReaderSize create fail", err);
}
@@ -275,7 +277,7 @@ func TestNewReaderSizeIdempotent(t *testing.T) {
func TestNewWriterSizeIdempotent(t *testing.T) {
const BufSize = 1000;
- b, err := NewWriterSize(new(io.ByteBuffer), BufSize);
+ b, err := NewWriterSize(new(bytes.Buffer), BufSize);
if err != nil {
t.Error("NewWriterSize create fail", err);
}