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

Function negative_width

oxide_math/test/cube.rs:46–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 #[test]
45 #[should_panic]
46 fn negative_width() {
47 let mut world = World::default();
48 let rect_entity: Entity = world.push((Cube {
49 width: 1.0f32,
50 height: 1.0f32,
51 length: 1.0f32,
52 },));
53 set_cube_size(&mut world, &rect_entity, -2.0f32, 3.0f32, 4.0f32);
54
55 if let Some(entry) = world.entry(rect_entity) {
56 let cube: Cube = *entry.get_component::<Cube>().unwrap();
57 assert_approx_eq!(cube.width, -2.0f32);
58 assert_approx_eq!(cube.height, 3.0f32);
59 assert_approx_eq!(cube.length, 4.0f32);
60 }
61 }
62
63 #[test]
64 #[should_panic]

Callers

nothing calls this directly

Calls 1

set_cube_sizeFunction · 0.85

Tested by

no test coverage detected