()
| 41 | #[test] |
| 42 | #[should_panic] |
| 43 | fn negative_width() { |
| 44 | let mut world = World::default(); |
| 45 | let rect_entity: Entity = world.push((Rect { |
| 46 | width: 1.0f32, |
| 47 | height: 1.0f32, |
| 48 | },)); |
| 49 | set_rect_size(&mut world, &rect_entity, -2.0f32, 3.0f32); |
| 50 | |
| 51 | if let Some(entry) = world.entry(rect_entity) { |
| 52 | let rect: Rect = *entry.get_component::<Rect>().unwrap(); |
| 53 | assert_approx_eq!(rect.width, -2.0f32); |
| 54 | assert_approx_eq!(rect.height, 3.0f32); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | #[test] |
| 59 | #[should_panic] |
nothing calls this directly
no test coverage detected