summaryrefslogtreecommitdiff
path: root/queue/queue_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'queue/queue_test.go')
-rw-r--r--queue/queue_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/queue/queue_test.go b/queue/queue_test.go
index 6be87be..25290f1 100644
--- a/queue/queue_test.go
+++ b/queue/queue_test.go
@@ -20,6 +20,13 @@ func TestElementaryPriority(t *testing.T) {
}
}
+func TestHeapPriority(t *testing.T) {
+ q := NewHeapPriority(1)
+ for i := minLength; i <= maxLength; i *= factor {
+ test(q, i, t)
+ }
+}
+
func test(q PriorityQueue, l int, t *testing.T) {
cb := func(t *testing.T) {
t.Parallel()
@@ -52,6 +59,13 @@ func BenchmarkElementaryPriority(b *testing.B) {
}
}
+func BenchmarkHeapPriority(b *testing.B) {
+ q := NewHeapPriority(1)
+ for i := minLength; i <= maxLength; i *= factor {
+ benchmark(q, i, b)
+ }
+}
+
func benchmark(q PriorityQueue, l int, b *testing.B) {
benchResult = ds.NewRandomArrayList(l, -1)