mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
return "<nil>" when calling String() on a nil bytes.Buffer.
R=rsc CC=go-dev http://go/go-review/1016005
This commit is contained in:
parent
aa0c811317
commit
63e668d2ad
2 changed files with 13 additions and 1 deletions
|
|
@ -232,3 +232,11 @@ func TestMixedReadsAndWrites(t *testing.T) {
|
|||
}
|
||||
empty(t, "TestMixedReadsAndWrites (2)", &buf, s, make([]byte, buf.Len()));
|
||||
}
|
||||
|
||||
|
||||
func TestNil(t *testing.T) {
|
||||
var b *Buffer;
|
||||
if b.String() != "<nil>" {
|
||||
t.Error("expcted <nil>; got %q", b.String());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue