()
| 25 | |
| 26 | #[test] |
| 27 | fn reset_width_and_height() { |
| 28 | let mut world = World::default(); |
| 29 | let rect_entity: Entity = world.push((Cube { |
| 30 | width: 1.0f32, |
| 31 | height: 1.0f32, |
| 32 | length: 1.0f32, |
| 33 | },)); |
| 34 | set_cube_size(&mut world, &rect_entity, 2.0f32, 3.0f32, 4.0f32); |
| 35 | |
| 36 | if let Some(entry) = world.entry(rect_entity) { |
| 37 | let cube: Cube = *entry.get_component::<Cube>().unwrap(); |
| 38 | assert_approx_eq!(cube.width, 2.0f32); |
| 39 | assert_approx_eq!(cube.height, 3.0f32); |
| 40 | assert_approx_eq!(cube.length, 4.0f32); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | #[test] |
| 45 | #[should_panic] |
nothing calls this directly
no test coverage detected