()
| 8 | #[test] |
| 9 | #[should_panic] |
| 10 | fn no_cube_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_cube_size(&mut world, &rect_entity, 2.0f32, 3.0f32, 4.0f32); |
| 17 | |
| 18 | if let Some(entry) = world.entry(rect_entity) { |
| 19 | let cube: Cube = *entry.get_component::<Cube>().unwrap(); |
| 20 | assert_approx_eq!(cube.width, 2.0f32); |
| 21 | assert_approx_eq!(cube.height, 3.0f32); |
| 22 | assert_approx_eq!(cube.length, 4.0f32); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | #[test] |
| 27 | fn reset_width_and_height() { |
nothing calls this directly
no test coverage detected