()
| 139 | #[test] |
| 140 | #[should_panic] |
| 141 | fn zero_height() { |
| 142 | let mut world = World::default(); |
| 143 | let rect_entity: Entity = world.push((Cube { |
| 144 | width: 1.0f32, |
| 145 | height: 1.0f32, |
| 146 | length: 1.0f32, |
| 147 | },)); |
| 148 | set_cube_size(&mut world, &rect_entity, 2.0f32, 0.0f32, 4.0f32); |
| 149 | |
| 150 | if let Some(entry) = world.entry(rect_entity) { |
| 151 | let cube: Cube = *entry.get_component::<Cube>().unwrap(); |
| 152 | assert_approx_eq!(cube.width, 2.0f32); |
| 153 | assert_approx_eq!(cube.height, 0.0f32); |
| 154 | assert_approx_eq!(cube.length, 4.0f32); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | #[test] |
| 159 | #[should_panic] |
nothing calls this directly
no test coverage detected