crypto: Test length
This commit is contained in:
parent
f8e1043ad3
commit
7a7cc5b39f
1 changed files with 3 additions and 1 deletions
|
@ -126,9 +126,11 @@ func BenchmarkEncryptWriter(b *testing.B) {
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
rd.Seek(0, 0)
|
rd.Seek(0, 0)
|
||||||
wr := crypto.EncryptTo(k, ioutil.Discard)
|
wr := crypto.EncryptTo(k, ioutil.Discard)
|
||||||
_, err := io.Copy(wr, rd)
|
n, err := io.Copy(wr, rd)
|
||||||
OK(b, err)
|
OK(b, err)
|
||||||
OK(b, wr.Close())
|
OK(b, wr.Close())
|
||||||
|
Assert(b, n == int64(size),
|
||||||
|
"not enough bytes writter: want %d, got %d", size, n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue