summaryrefslogtreecommitdiff
path: root/src/pkg/bytes/buffer_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/bytes/buffer_test.go')
-rw-r--r--src/pkg/bytes/buffer_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/pkg/bytes/buffer_test.go b/src/pkg/bytes/buffer_test.go
index d4862459d..c9dafad40 100644
--- a/src/pkg/bytes/buffer_test.go
+++ b/src/pkg/bytes/buffer_test.go
@@ -240,3 +240,25 @@ func TestNil(t *testing.T) {
t.Error("expcted <nil>; got %q", b.String())
}
}
+
+
+func TestReadFrom(t *testing.T) {
+ var buf Buffer;
+ for i := 3; i < 30; i += 3 {
+ s := fillBytes(t, "TestReadFrom (1)", &buf, "", 5, bytes[0:len(bytes)/i]);
+ var b Buffer;
+ b.ReadFrom(&buf);
+ empty(t, "TestReadFrom (2)", &b, s, make([]byte, len(data)));
+ }
+}
+
+
+func TestWriteTo(t *testing.T) {
+ var buf Buffer;
+ for i := 3; i < 30; i += 3 {
+ s := fillBytes(t, "TestReadFrom (1)", &buf, "", 5, bytes[0:len(bytes)/i]);
+ var b Buffer;
+ buf.WriteTo(&b);
+ empty(t, "TestReadFrom (2)", &b, s, make([]byte, len(data)));
+ }
+}