From: Jérôme Benoit Date: Sat, 26 Aug 2023 20:36:32 +0000 (+0200) Subject: test: improve deque coverage X-Git-Tag: v2.6.36~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cedafbde37abbe37b0f0da08bda0cbfb7dd2be26;p=poolifier.git test: improve deque coverage Signed-off-by: Jérôme Benoit --- diff --git a/tests/deque.test.js b/tests/deque.test.js index 8521047d..386b8ae1 100644 --- a/tests/deque.test.js +++ b/tests/deque.test.js @@ -96,6 +96,22 @@ describe('Deque test suite', () => { expect(deque.tail).toBeUndefined() }) + it('Verify peekFirst() behavior', () => { + const deque = new Deque() + deque.push(1) + deque.push(2) + deque.push(3) + expect(deque.peekFirst()).toBe(1) + }) + + it('Verify peekLast() behavior', () => { + const deque = new Deque() + deque.push(1) + deque.push(2) + deque.push(3) + expect(deque.peekLast()).toBe(3) + }) + it('Verify clear() behavior', () => { const deque = new Deque() deque.push(1)