()
| 8 | #[test] |
| 9 | #[should_panic] |
| 10 | fn no_rect_component() { |
| 11 | let mut world = World::default(); |
| 12 | let rect_entity: Entity = world.push((Position { |
| 13 | x: 1.0f32, |
| 14 | y: 1.0f32, |
| 15 | },)); |
| 16 | set_rect_size(&mut world, &rect_entity, 2.0f32, 3.0f32); |
| 17 | |
| 18 | if let Some(entry) = world.entry(rect_entity) { |
| 19 | let rect: Rect = *entry.get_component::<Rect>().unwrap(); |
| 20 | assert_approx_eq!(rect.width, 2.0f32); |
| 21 | assert_approx_eq!(rect.height, 3.0f32); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | #[test] |
| 26 | fn reset_width_and_height() { |
nothing calls this directly
no test coverage detected