summaryrefslogtreecommitdiff
path: root/search/search_test.go
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2020-12-21 20:57:20 +0000
committerPaul Buetow <git@mx.buetow.org>2020-12-21 20:57:20 +0000
commitcea272d7a6a0281e589d8e6fcaa89b7c6c6860ab (patch)
treeeb82d9dfa3cfbc1fb1826107817a76667fd8eddb /search/search_test.go
parente80cca57e072cf902f3e91ebe05f1ab8fbd55af8 (diff)
initial hash map
Diffstat (limited to 'search/search_test.go')
-rw-r--r--search/search_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/search/search_test.go b/search/search_test.go
index ec977cc..22f56d4 100644
--- a/search/search_test.go
+++ b/search/search_test.go
@@ -33,6 +33,12 @@ func TestRedBlackBST(t *testing.T) {
}
}
+func TestHash(t *testing.T) {
+ for i := minLength; i <= maxLength; i *= factor {
+ test(NewHash(), i, t)
+ }
+}
+
func TestGoMap(t *testing.T) {
for i := minLength; i <= maxLength; i *= factor {
test(NewGoMap(), i, t)
@@ -121,6 +127,13 @@ func BenchmarkRedBlackBST(t *testing.B) {
}
}
+func BenchmarkHash(t *testing.B) {
+ s := NewHash()
+ for i := minLength; i <= maxLength; i *= factor {
+ benchmark(s, i, t)
+ }
+}
+
func BenchmarkGoMap(t *testing.B) {
s := NewGoMap()
for i := minLength; i <= maxLength; i *= factor {