A node that already has children will not have the root updated on its children when it is inserted into a tree.
For example, the below test will fail on the last assertion. Is this intentional (maybe to save time not having to walk descendants), or is this an oversight?
#[test]
fn root_5() {
let mut node1 = Node::new("node1");
let mut node2 = Node::new("node2");
let node3 = Node::new("node3");
node2.append(node3.clone());
node1.append(node2.clone());
assert_eq!(node1.root(), node1);
assert_eq!(node2.root(), node1);
assert_eq!(node3.root(), node1);
}
A node that already has children will not have the root updated on its children when it is inserted into a tree.
For example, the below test will fail on the last assertion. Is this intentional (maybe to save time not having to walk descendants), or is this an oversight?