Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
/** @inheritdoc */
public enqueue (data: T, priority?: number): number {
if (this.full()) {
- throw new Error('Priority queue is full')
+ throw new Error('Fixed priority queue is full')
}
priority = priority ?? 0
let inserted = false
/** @inheritdoc */
public enqueue (data: T, priority?: number): number {
if (this.full()) {
- throw new Error('Priority queue is full')
+ throw new Error('Fixed queue is full')
}
let index = this.start + this.size
if (index >= this.capacity) {
])
expect(fixedPriorityQueue.capacity).toBe(queueSize)
expect(() => fixedPriorityQueue.enqueue(4)).toThrow(
- new Error('Priority queue is full')
+ new Error('Fixed priority queue is full')
)
})
])
expect(fixedQueue.capacity).toBe(queueSize)
expect(() => fixedQueue.enqueue(4)).toThrow(
- new Error('Priority queue is full')
+ new Error('Fixed queue is full')
)
})