We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e13fd6b commit 0cfb79dCopy full SHA for 0cfb79d
tests/leaf_nodes.rs
@@ -2,14 +2,25 @@
2
3
use orx_tree::*;
4
5
+#[test]
6
+fn root_into_new_tree() {
7
+ let mut tree = DynTree::new(0);
8
+
9
+ let tree2: DynTree<_> = tree.root_mut().into_new_tree();
10
11
+ assert_eq!(tree2.len(), 1);
12
+ assert_eq!(
13
+ tree2.root().walk::<Dfs>().copied().collect::<Vec<_>>(),
14
+ vec![0]
15
+ );
16
+}
17
18
/// https://github.com/orxfun/orx-tree/issues/183
19
#[test]
20
fn leaf_into_new_tree() {
21
let mut tree = DynTree::new(0);
22
tree.root_mut().push_child(1);
23
- // Does not panic if we add a children to 1
- // tree.root_mut().children_mut().next().unwrap().push_child(2);
24
let tree2: DynTree<_> = tree
25
.root_mut()
26
.children_mut()
0 commit comments