()
| 75 | #[test] |
| 76 | #[should_panic] |
| 77 | fn negative_width_and_height() { |
| 78 | let mut world = World::default(); |
| 79 | let rect_entity: Entity = world.push((Rect { |
| 80 | width: 1.0f32, |
| 81 | height: 1.0f32, |
| 82 | },)); |
| 83 | set_rect_size(&mut world, &rect_entity, -2.0f32, -3.0f32); |
| 84 | |
| 85 | if let Some(entry) = world.entry(rect_entity) { |
| 86 | let rect: Rect = *entry.get_component::<Rect>().unwrap(); |
| 87 | assert_approx_eq!(rect.width, -2.0f32); |
| 88 | assert_approx_eq!(rect.height, -3.0f32); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | #[test] |
| 93 | #[should_panic] |
nothing calls this directly
no test coverage detected