mirror of
https://github.com/TheodoreKrypton/tgfs
synced 2024-11-22 07:04:35 +00:00
complete unit test of queue
This commit is contained in:
parent
f2ccaca171
commit
a10d22db78
@ -14,6 +14,15 @@ describe('Queue', () => {
|
||||
expect(queue.size()).toBe(2);
|
||||
});
|
||||
|
||||
test('enqueueFront adds elements to the front of the queue', () => {
|
||||
queue.enqueue(1);
|
||||
queue.enqueue(2);
|
||||
queue.enqueueFront(3);
|
||||
expect(queue.dequeue()).toBe(3);
|
||||
expect(queue.dequeue()).toBe(1);
|
||||
expect(queue.dequeue()).toBe(2);
|
||||
});
|
||||
|
||||
test('dequeue removes and returns elements from the queue', () => {
|
||||
queue.enqueue(1);
|
||||
queue.enqueue(2);
|
||||
|
Loading…
Reference in New Issue
Block a user