Tests for bfs