aboutsummaryrefslogtreecommitdiff
path: root/internal/hash/hash_func_test.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2019-01-16 02:01:09 +0100
committerDimitri Sokolyuk <demon@dim13.org>2019-01-16 02:01:09 +0100
commita09cffcde579451343e9ab9a614cf6a9b65ed812 (patch)
tree95f33a1cc2da03319e6cab644aea8a4dff255e01 /internal/hash/hash_func_test.go
parent3743e23f4054d34a03f88105e79521154bc5c3d3 (diff)
rename
Diffstat (limited to 'internal/hash/hash_func_test.go')
-rw-r--r--internal/hash/hash_func_test.go44
1 files changed, 0 insertions, 44 deletions
diff --git a/internal/hash/hash_func_test.go b/internal/hash/hash_func_test.go
deleted file mode 100644
index 458b306..0000000
--- a/internal/hash/hash_func_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package hash
-
-import "testing"
-
-func TestDefaultHash(t *testing.T) {
- testCases := []struct {
- key string
- want uint32
- }{
- {"", 0},
- {"A", 65},
- {"AA", 2210},
- {"AAA", 72995},
- {"AAAA", 2408900},
- {"AAAAA", 79493765},
- {"AAAAAA", 2623294310},
- {"AAAAAAA", 669366375},
- {"AAAAAAAA", 614253960},
- {"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", 3607767976},
- }
- for _, tc := range testCases {
- t.Run(tc.key, func(t *testing.T) {
- got := defaultHash([]byte(tc.key))
- if got != tc.want {
- t.Errorf("got %v, want %v", got, tc.want)
- }
- })
- }
-}
-
-func BenchmarkDefaultHash(b *testing.B) {
- benchCases := []string{
- "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
- "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG",
- }
- for _, bc := range benchCases {
- b.Run(bc, func(b *testing.B) {
- key := []byte(bc)
- for i := 0; i < b.N; i++ {
- defaultHash(key)
- }
- })
- }
-}