expect(priorityQueue.maxSize).toBe(6)
expect(priorityQueue.tail.empty()).toBe(false)
expect(priorityQueue.tail.next).toBeInstanceOf(FixedPriorityQueue)
+ expect(priorityQueue.tail).not.toStrictEqual(priorityQueue.head)
let rtItem = priorityQueue.dequeue(3)
expect(priorityQueue.buckets).toBe(2)
expect(priorityQueue.size).toBe(5)
expect(rtItem).toBe(3)
expect(priorityQueue.tail.empty()).toBe(false)
expect(priorityQueue.tail.next).toBeInstanceOf(FixedPriorityQueue)
+ expect(priorityQueue.tail).not.toStrictEqual(priorityQueue.head)
rtItem = priorityQueue.dequeue()
expect(priorityQueue.buckets).toBe(2)
expect(priorityQueue.size).toBe(4)
expect(rtItem).toBe(1)
expect(priorityQueue.tail.empty()).toBe(false)
expect(priorityQueue.tail.next).toBeInstanceOf(FixedPriorityQueue)
+ expect(priorityQueue.tail).not.toStrictEqual(priorityQueue.head)
rtItem = priorityQueue.dequeue(2)
expect(priorityQueue.buckets).toBe(1)
expect(priorityQueue.size).toBe(3)
expect(rtItem).toBe(3)
expect(priorityQueue.tail.empty()).toBe(false)
expect(priorityQueue.tail.next).toBeInstanceOf(FixedPriorityQueue)
+ expect(priorityQueue.tail).not.toStrictEqual(priorityQueue.head)
rtItem = priorityQueue.dequeue(2)
expect(priorityQueue.buckets).toBe(1)
expect(priorityQueue.size).toBe(2)
expect(rtItem).toBe(3)
expect(priorityQueue.tail.empty()).toBe(false)
expect(priorityQueue.tail.next).toBeInstanceOf(FixedPriorityQueue)
+ expect(priorityQueue.tail).not.toStrictEqual(priorityQueue.head)
rtItem = priorityQueue.dequeue(2)
expect(priorityQueue.buckets).toBe(0)
expect(priorityQueue.size).toBe(1)
expect(rtItem).toBe(1)
expect(priorityQueue.tail.empty()).toBe(false)
expect(priorityQueue.tail.next).toBe(undefined)
+ expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
rtItem = priorityQueue.dequeue()
expect(priorityQueue.buckets).toBe(0)
expect(priorityQueue.size).toBe(0)
expect(rtItem).toBe(2)
expect(priorityQueue.tail.empty()).toBe(true)
expect(priorityQueue.tail.next).toBe(undefined)
+ expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
})
it('Verify enablePriority setter behavior', () => {