]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_data_structures/graph/vec_graph/test.rs
librustc: Unconfigure tests during normal build
[rust.git] / src / librustc_data_structures / graph / vec_graph / test.rs
index 4a168ee1d44fda617085ce68d4c6175cd2b1b4dc..97a9bd2ad0b08c74fb5528ddcef46aab09669409 100644 (file)
@@ -1,5 +1,3 @@
-#![cfg(test)]
-
 use super::*;
 
 fn create_graph() -> VecGraph<usize> {
@@ -44,3 +42,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]);
+}