mirror of
https://github.com/golang/go.git
synced 2025-11-03 10:10:55 +00:00
bufio:
* avoid large copies * NewBufRead, NewBufWrite never fail * add BufReadWrite io: * add io.Close http, google/net/rpc: * add, use http.Conn.Hijack R=r DELTA=416 (202 added, 123 deleted, 91 changed) OCL=24153 CL=24238
This commit is contained in:
parent
535dcf77c8
commit
9aa28f9231
8 changed files with 249 additions and 170 deletions
|
|
@ -174,12 +174,12 @@ var bufsizes = []int {
|
|||
}
|
||||
|
||||
func TestBufReadSimple(t *testing.T) {
|
||||
b, e := NewBufRead(newByteReader(io.StringBytes("hello world")));
|
||||
b := NewBufRead(newByteReader(io.StringBytes("hello world")));
|
||||
if s := readBytes(b); s != "hello world" {
|
||||
t.Errorf("simple hello world test failed: got %q", s);
|
||||
}
|
||||
|
||||
b, e = NewBufRead(newRot13Reader(newByteReader(io.StringBytes("hello world"))));
|
||||
b = NewBufRead(newRot13Reader(newByteReader(io.StringBytes("hello world"))));
|
||||
if s := readBytes(b); s != "uryyb jbeyq" {
|
||||
t.Error("rot13 hello world test failed: got %q", s);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue