Skip to content

Commit

Permalink
Mark specific test functions as unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikeForceZero committed Apr 30, 2024
1 parent 4c8d256 commit 14bcd1e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/bevy_ui/src/layout/ui_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ mod tests {
assert!(ui_surface.taffy.is_root_node_pair_valid(root_node_pair));
}

#[allow(unreachable_code)]
#[test]
fn test_remove_camera_entities() {
let mut ui_surface = UiSurface::default();
Expand Down Expand Up @@ -439,14 +440,17 @@ mod tests {
assert!(!ui_surface
.camera_entity_to_taffy
.contains_key(&camera_entity));
return; // TODO: can't pass the test if we continue - not implemented

return; // TODO: can't pass the test if we continue - not implemented (remove allow(unreachable_code))

assert!(!ui_surface.camera_roots.contains_key(&camera_entity));

// root node pair should be removed
let root_node_pair = ui_surface.get_root_node_pair_exact(root_node_entity, camera_entity);
assert_eq!(root_node_pair, None);
}

#[allow(unreachable_code)]
#[test]
fn test_remove_entities() {
let mut ui_surface = UiSurface::default();
Expand Down Expand Up @@ -476,7 +480,8 @@ mod tests {
ui_surface.remove_entities([root_node_entity]);
assert!(!ui_surface.entity_to_taffy.contains_key(&root_node_entity));

return; // TODO: can't pass the test if we continue - not implemented
return; // TODO: can't pass the test if we continue - not implemented (remove allow(unreachable_code))

assert!(!ui_surface
.camera_entity_to_taffy
.get(&camera_entity)
Expand Down Expand Up @@ -526,6 +531,7 @@ mod tests {
assert_eq!(ui_surface.taffy.parent(child_node), Some(parent_node));
}

#[allow(unreachable_code)]
#[test]
fn test_set_camera_children() {
let mut ui_surface = UiSurface::default();
Expand Down Expand Up @@ -584,7 +590,7 @@ mod tests {
// clear camera's root nodes
ui_surface.set_camera_children(camera_entity, Vec::<Entity>::new().into_iter());

return; // TODO: can't pass the test if we continue - not implemented
return; // TODO: can't pass the test if we continue - not implemented (remove allow(unreachable_code))

assert!(
!ui_surface
Expand Down

0 comments on commit 14bcd1e

Please sign in to comment.