Add tests for dfs