Skip to content

Commit 8a8207f

Browse files
committed
added unit test for same value check in avl
1 parent 32f25ef commit 8a8207f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/avl-tree/__test__/avl.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,10 @@ describe("AVL Tree", () => {
4949
expect(right.getValue()).toBe(9);
5050
expect(avlTree.getRoot().nodeHeight()).toBe(1);
5151
});
52+
53+
it("should not add node with the same value", () => {
54+
const isNodeInsterted = avlTree.insert(new Int(9));
55+
expect(isNodeInsterted).toBeFalsy();
56+
})
5257
})
5358
})

0 commit comments

Comments
 (0)