summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/hmac/hmac_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-15 15:33:31 -0800
committerRobert Griesemer <gri@golang.org>2009-12-15 15:33:31 -0800
commitd9527dd16f72598b54a64550607bf892efa12384 (patch)
tree2ad16a7db2d3c484b47426ad2568359ab633820c /src/pkg/crypto/hmac/hmac_test.go
parentaea97e0bd7da9cef1cc631ddbd3578a0877a4fcc (diff)
downloadgolang-d9527dd16f72598b54a64550607bf892efa12384.tar.gz
1) Change default gofmt default settings for
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 1st set of files. R=rsc CC=agl, golang-dev, iant, ken2, r http://codereview.appspot.com/180047
Diffstat (limited to 'src/pkg/crypto/hmac/hmac_test.go')
-rw-r--r--src/pkg/crypto/hmac/hmac_test.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/pkg/crypto/hmac/hmac_test.go b/src/pkg/crypto/hmac/hmac_test.go
index 1c81fd990..98e32df01 100644
--- a/src/pkg/crypto/hmac/hmac_test.go
+++ b/src/pkg/crypto/hmac/hmac_test.go
@@ -5,17 +5,17 @@
package hmac
import (
- "hash";
- "fmt";
- "strings";
- "testing";
+ "hash"
+ "fmt"
+ "strings"
+ "testing"
)
type hmacTest struct {
- hash func([]byte) hash.Hash;
- key []byte;
- in []byte;
- out string;
+ hash func([]byte) hash.Hash
+ key []byte
+ in []byte
+ out string
}
// Tests from US FIPS 198
@@ -78,20 +78,20 @@ var hmacTests = []hmacTest{
func TestHMAC(t *testing.T) {
for i, tt := range hmacTests {
- h := tt.hash(tt.key);
+ h := tt.hash(tt.key)
for j := 0; j < 2; j++ {
- n, err := h.Write(tt.in);
+ n, err := h.Write(tt.in)
if n != len(tt.in) || err != nil {
- t.Errorf("test %d.%d: Write(%d) = %d, %v", i, j, len(tt.in), n, err);
- continue;
+ t.Errorf("test %d.%d: Write(%d) = %d, %v", i, j, len(tt.in), n, err)
+ continue
}
- sum := fmt.Sprintf("%x", h.Sum());
+ sum := fmt.Sprintf("%x", h.Sum())
if sum != tt.out {
t.Errorf("test %d.%d: have %s want %s\n", i, j, sum, tt.out)
}
// Second iteration: make sure reset works.
- h.Reset();
+ h.Reset()
}
}
}