summaryrefslogtreecommitdiff
path: root/src/pkg/io/pipe_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/io/pipe_test.go')
-rw-r--r--src/pkg/io/pipe_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/pkg/io/pipe_test.go b/src/pkg/io/pipe_test.go
index 793bed459..b0ee0f20b 100644
--- a/src/pkg/io/pipe_test.go
+++ b/src/pkg/io/pipe_test.go
@@ -236,3 +236,25 @@ func TestPipeWriteClose(t *testing.T) {
}
}
}
+
+func TestWriteEmpty(t *testing.T) {
+ r, w := Pipe()
+ go func() {
+ w.Write([]byte{})
+ w.Close()
+ }()
+ var b [2]byte
+ ReadFull(r, b[0:2])
+ r.Close()
+}
+
+func TestWriteNil(t *testing.T) {
+ r, w := Pipe()
+ go func() {
+ w.Write(nil)
+ w.Close()
+ }()
+ var b [2]byte
+ ReadFull(r, b[0:2])
+ r.Close()
+}