MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / test_classify_angle

Function test_classify_angle

src/lib.rs:2317–2329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2315
2316 #[test]
2317 fn test_classify_angle() {
2318 use math::{classify_angle, AngleType};
2319 assert_eq!(classify_angle(0.0), AngleType::Zero);
2320 assert_eq!(classify_angle(std::f32::consts::TAU), AngleType::Zero);
2321 assert_eq!(classify_angle(-std::f32::consts::TAU), AngleType::Zero);
2322 assert_eq!(classify_angle(std::f32::consts::FRAC_PI_2), AngleType::Right90);
2323 assert_eq!(classify_angle(std::f32::consts::PI), AngleType::Straight180);
2324 assert_eq!(classify_angle(3.0 * std::f32::consts::FRAC_PI_2), AngleType::Right270);
2325 match classify_angle(1.0) {
2326 AngleType::Arbitrary(v) => assert!((v - 1.0).abs() < 0.01),
2327 other => panic!("Expected Arbitrary, got {:?}", other),
2328 }
2329 }
2330
2331 #[test]
2332 fn test_compute_rotated_aabb_zero() {

Callers

nothing calls this directly

Calls 1

classify_angleFunction · 0.85

Tested by

no test coverage detected