From: Jérôme Benoit Date: Sat, 3 Jun 2023 09:44:01 +0000 (+0200) Subject: test: improve queue test X-Git-Tag: v2.5.3~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a715ab843cbc30a366c1925ab221caee0e43b173;p=poolifier.git test: improve queue test Signed-off-by: Jérôme Benoit --- diff --git a/tests/queue.test.js b/tests/queue.test.js index 6451b732..3a61f43d 100644 --- a/tests/queue.test.js +++ b/tests/queue.test.js @@ -37,18 +37,21 @@ describe('Queue test suite', () => { expect(rtItem).toBe(1) expect(queue.head).toBe(1) expect(queue.tail).toBe(3) + expect(queue.max).toBe(3) expect(queue.items).toStrictEqual({ 1: 2, 2: 3 }) rtItem = queue.dequeue() expect(queue.size).toBe(1) expect(rtItem).toBe(2) expect(queue.head).toBe(2) expect(queue.tail).toBe(3) + expect(queue.max).toBe(3) expect(queue.items).toStrictEqual({ 2: 3 }) rtItem = queue.dequeue() expect(queue.size).toBe(0) expect(rtItem).toBe(3) expect(queue.head).toBe(0) expect(queue.tail).toBe(0) + expect(queue.max).toBe(3) expect(queue.items).toStrictEqual({}) }) })