Skip to content

Commit af6de19

Browse files
committed
Add test case for parent update
1 parent 6823897 commit af6de19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/graphs/searching/bfs.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,11 @@ describe('BFS', function () {
3434
expect(bfs(graph, 0, 2)).toBeFalsy();
3535
});
3636

37+
it('should not update the parent node once set', function () {
38+
var graph = [[0, 1, 1],
39+
[0, 0, 1],
40+
[0, 0, 0]];
41+
expect(bfs(graph, 0, 2)).toEqual([0, 2]);
42+
});
43+
3744
});

0 commit comments

Comments
 (0)