summaryrefslogtreecommitdiff
path: root/pkg/priority_queue/binary_heap_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/priority_queue/binary_heap_test.go')
-rw-r--r--pkg/priority_queue/binary_heap_test.go21
1 files changed, 18 insertions, 3 deletions
diff --git a/pkg/priority_queue/binary_heap_test.go b/pkg/priority_queue/binary_heap_test.go
index afeae62c..528e8fd0 100644
--- a/pkg/priority_queue/binary_heap_test.go
+++ b/pkg/priority_queue/binary_heap_test.go
@@ -3,11 +3,26 @@ package priorityqueue
import (
"testing"
+ priorityqueue "github.com/spiral/roadrunner/v2/common/priority_queue"
"github.com/stretchr/testify/require"
)
type Test int
+func (t Test) Ack() {
+}
+
+func (t Test) Nack() {
+}
+
+func (t Test) Body() []byte {
+ return nil
+}
+
+func (t Test) Context() []byte {
+ return nil
+}
+
func (t Test) ID() string {
return ""
}
@@ -17,7 +32,7 @@ func (t Test) Priority() uint64 {
}
func TestBinHeap_Init(t *testing.T) {
- a := []PQItem{Test(2), Test(23), Test(33), Test(44), Test(1), Test(2), Test(2), Test(2), Test(4), Test(6), Test(99)}
+ a := []priorityqueue.Item{Test(2), Test(23), Test(33), Test(44), Test(1), Test(2), Test(2), Test(2), Test(4), Test(6), Test(99)}
bh := NewBinHeap()
@@ -25,9 +40,9 @@ func TestBinHeap_Init(t *testing.T) {
bh.Insert(a[i])
}
- expected := []PQItem{Test(1), Test(2), Test(2), Test(2), Test(2), Test(4), Test(6), Test(23), Test(33), Test(44), Test(99)}
+ expected := []priorityqueue.Item{Test(1), Test(2), Test(2), Test(2), Test(2), Test(4), Test(6), Test(23), Test(33), Test(44), Test(99)}
- res := make([]PQItem, 0, 12)
+ res := make([]priorityqueue.Item, 0, 12)
for i := 0; i < 11; i++ {
item := bh.GetMax()