Skip to main content

assert_approx_eq

Function assert_approx_eq 

Source
pub fn assert_approx_eq(actual: f32, expected: f32, tolerance: f32, msg: &str)
Expand description

Assert that a value is within an expected range.

This is useful for fuzzy matching of positions and sizes that might vary slightly due to rendering.

ยงExample

use cranpose_testing::robot_assertions::assert_approx_eq;
assert_approx_eq(100.05, 100.0, 0.1, "Width should be approx 100");