Skip to content

Commit eaa1d58

Browse files
committed
Using public API instead of private properties
1 parent 15cbe48 commit eaa1d58

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/data-structures/red-black-tree.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ describe('RBTree', function () {
5959
expect(tree._root._left).not.toBeNull();
6060
expect(tree._root._left.isRed()).toBeTruthy();
6161
tree.put(2, 'baz');
62-
expect(tree._root._right).not.toBeNull();
63-
expect(tree._root._right.isRed()).toBeFalsy();
62+
expect(tree._root.getRight()).not.toBeNull();
63+
expect(tree._root.getRight().isRed()).toBeFalsy();
6464

6565
tree = new RBTree();
6666
tree.put(1, 'bar');
6767
tree.put(2, 'foo');
6868
tree.put(3, 'baz');
69-
expect(tree._root._right).not.toBeNull();
69+
expect(tree._root.getRight()).not.toBeNull();
7070
expect(tree._root._left).not.toBeNull();
7171
expect(tree._root.isRed()).toBeFalsy();
72-
expect(tree._root._right.isRed()).toBeFalsy();
72+
expect(tree._root.getRight().isRed()).toBeFalsy();
7373
expect(tree._root._left.isRed()).toBeFalsy();
7474
tree.put(4, 'foobar');
7575
tree.put(5, 'foobar');
76-
expect(tree._root._right._right).not.toBeNull();
77-
expect(tree._root._right._right.isRed()).toBeFalsy();
76+
expect(tree._root.getRight().getRight()).not.toBeNull();
77+
expect(tree._root.getRight().getRight().isRed()).toBeFalsy();
7878
});
7979

8080
});

0 commit comments

Comments
 (0)