MCPcopy Create free account
hub / github.com/OxideEngine/Oxide / negative_width_and_height

Function negative_width_and_height

oxide_math/test/rect.rs:77–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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]

Callers

nothing calls this directly

Calls 1

set_rect_sizeFunction · 0.85

Tested by

no test coverage detected