diff options
Diffstat (limited to 'src/librustc_data_structures/graph/vec_graph')
| -rw-r--r-- | src/librustc_data_structures/graph/vec_graph/test.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc_data_structures/graph/vec_graph/test.rs b/src/librustc_data_structures/graph/vec_graph/test.rs index 4a168ee1d44..c54a72264f6 100644 --- a/src/librustc_data_structures/graph/vec_graph/test.rs +++ b/src/librustc_data_structures/graph/vec_graph/test.rs @@ -44,3 +44,10 @@ fn succesors() { assert_eq!(graph.successors(5), &[1]); assert_eq!(graph.successors(6), &[]); } + +#[test] +fn dfs() { + let graph = create_graph(); + let dfs: Vec<_> = graph.depth_first_search(0).collect(); + assert_eq!(dfs, vec![0, 1, 3, 4, 2]); +} |
