improve future_moves tests

This commit is contained in:
Simon Gardling 2025-02-22 12:19:49 -05:00
parent ad39d647b7
commit aad3ea0c0a
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -374,7 +374,7 @@ mod tests {
lazy_children: false, lazy_children: false,
}); });
futm.current_root = Some(0); futm.update_root_idx_raw(0);
// child 1 // child 1
futm.arena.push(Move::new( futm.arena.push(Move::new(
@ -442,9 +442,23 @@ mod tests {
lazy_children: false, lazy_children: false,
}); });
futm.current_root = Some(0); futm.update_root_idx_raw(0);
futm.extend_layers(); futm.extend_layers();
assert_eq!(futm.arena_len(), 5); assert_eq!(futm.arena_len(), 5);
// move to a child
futm.update_root_idx_raw(1);
futm.refocus_tree();
assert_eq!(futm.arena_len(), 1);
// make sure current_root is properly updated
assert_eq!(futm.current_root, Some(0));
futm.extend_layers();
assert!(
futm.arena_len() > 1,
"extend_layer didn't grow arena after refocus"
);
} }
} }