test: improve queue test
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Jun 2023 09:22:58 +0000 (11:22 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 3 Jun 2023 09:22:58 +0000 (11:22 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/queue.test.js

index 93211106650fd2317be2aa22589cb60122bb641e..6451b732e2c71d9753e1344f5b3683ed70f2f205 100644 (file)
@@ -9,18 +9,21 @@ describe('Queue test suite', () => {
     expect(rtSize).toBe(queue.size)
     expect(queue.head).toBe(0)
     expect(queue.tail).toBe(1)
+    expect(queue.max).toBe(1)
     expect(queue.items).toStrictEqual({ 0: 1 })
     rtSize = queue.enqueue(2)
     expect(queue.size).toBe(2)
     expect(rtSize).toBe(queue.size)
     expect(queue.head).toBe(0)
     expect(queue.tail).toBe(2)
+    expect(queue.max).toBe(2)
     expect(queue.items).toStrictEqual({ 0: 1, 1: 2 })
     rtSize = queue.enqueue(3)
     expect(queue.size).toBe(3)
     expect(rtSize).toBe(queue.size)
     expect(queue.head).toBe(0)
     expect(queue.tail).toBe(3)
+    expect(queue.max).toBe(3)
     expect(queue.items).toStrictEqual({ 0: 1, 1: 2, 2: 3 })
   })