HashingWriter: Track size
This commit is contained in:
parent
b816192d1c
commit
fb2cd7b485
2 changed files with 14 additions and 3 deletions
|
@ -68,6 +68,10 @@ func TestHashingWriter(t *testing.T) {
|
|||
"HashAppendWriter: invalid number of bytes written: got %d, expected %d",
|
||||
n, size)
|
||||
|
||||
assert(t, wr.Size() == size,
|
||||
"HashAppendWriter: invalid number of bytes returned: got %d, expected %d",
|
||||
wr.Size, size)
|
||||
|
||||
resultingHash := wr.Sum(nil)
|
||||
assert(t, bytes.Equal(expectedHash[:], resultingHash),
|
||||
"HashAppendWriter: hashes do not match: expected %02x, got %02x",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue