diff --git a/mse/mse_test.go b/mse/mse_test.go index 6b5f82c3..bc14c168 100644 --- a/mse/mse_test.go +++ b/mse/mse_test.go @@ -2,7 +2,9 @@ package mse import ( "bytes" + "crypto/rand" "io" + "io/ioutil" "net" "sync" @@ -102,3 +104,19 @@ func BenchmarkHandshake(b *testing.B) { allHandshakeTests(b) } } + +type trackReader struct { + r io.Reader + n int64 +} + +func (me *trackReader) Read(b []byte) (n int, err error) { + n, err = me.r.Read(b) + me.n += int64(n) + return +} + +func TestReceiveRandomData(t *testing.T) { + tr := trackReader{rand.Reader, 0} + ReceiveHandshake(readWriter{&tr, ioutil.Discard}, nil) +}