Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dfdb6ec

Browse files
committedApr 8, 2023
test adjusting tail after insert at tail position
1 parent 019c07e commit dfdb6ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/data-structures/linked-list/__test__/LinkedList.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ describe('LinkedList', () => {
4343
linkedList.insert(2, 1);
4444
linkedList.insert(1, -7);
4545
linkedList.insert(10, 9);
46-
47-
expect(linkedList.toString()).toBe('1,4,2,3,10');
46+
linkedList.insert(7, 5);
47+
expect(linkedList.toString()).toBe('1,4,2,3,10,7');
48+
expect(linkedList.head.toString()).toBe('1');
49+
expect(linkedList.tail.toString()).toBe('7');
4850
});
4951

5052
it('should delete node by value from linked list', () => {

0 commit comments

Comments
 (0)
Please sign in to comment.