From: Jérôme Benoit Date: Sat, 3 Jun 2023 09:22:58 +0000 (+0200) Subject: test: improve queue test X-Git-Tag: v2.5.3~13 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2ada4138c4bc2448e73a39e78cc52e2bd2d31c1a;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 93211106..6451b732 100644 --- a/tests/queue.test.js +++ b/tests/queue.test.js @@ -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 }) })