From 0333e80d63afd4cc7595fab589feaf8140154bc7 Mon Sep 17 00:00:00 2001 From: Shawn Smith Date: Tue, 31 Dec 2013 23:13:05 +1100 Subject: [PATCH] crypto/sha1: add tests for Size() and BlockSize() R=golang-codereviews, dave CC=golang-codereviews https://golang.org/cl/46400044 --- src/pkg/crypto/sha1/sha1_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pkg/crypto/sha1/sha1_test.go b/src/pkg/crypto/sha1/sha1_test.go index c3868d702ac..6d2a9f24dcb 100644 --- a/src/pkg/crypto/sha1/sha1_test.go +++ b/src/pkg/crypto/sha1/sha1_test.go @@ -76,6 +76,20 @@ func TestGolden(t *testing.T) { } } +func TestSize(t *testing.T) { + c := New() + if got := c.Size(); got != Size { + t.Errorf("Size = %d; want %d", got, Size) + } +} + +func TestBlockSize(t *testing.T) { + c := New() + if got := c.BlockSize(); got != BlockSize { + t.Errorf("BlockSize = %d; want %d", got, BlockSize) + } +} + var bench = New() var buf = make([]byte, 8192)