2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-29 07:00:49 +00:00

crypto: Test length

This commit is contained in:
Alexander Neumann 2015-04-12 21:48:17 +02:00
parent f8e1043ad3
commit 7a7cc5b39f

View File

@ -126,9 +126,11 @@ func BenchmarkEncryptWriter(b *testing.B) {
for i := 0; i < b.N; i++ {
rd.Seek(0, 0)
wr := crypto.EncryptTo(k, ioutil.Discard)
_, err := io.Copy(wr, rd)
n, err := io.Copy(wr, rd)
OK(b, err)
OK(b, wr.Close())
Assert(b, n == int64(size),
"not enough bytes writter: want %d, got %d", size, n)
}
}