check_same_with

Function check_same_with 

Source
pub fn check_same_with<'f, T: Facet<'f>, U: Facet<'f>>(
    left: &T,
    right: &U,
    options: SameOptions,
) -> Sameness
Expand description

Check if two Facet values are structurally the same, with custom options.

Like check_same, but allows configuring comparison behavior via SameOptions.

ยงExample

use facet_assert::{check_same_with, SameOptions, Sameness};

let a = 1.0000001_f64;
let b = 1.0000002_f64;

// With tolerance, these are considered the same
let options = SameOptions::new().float_tolerance(1e-6);
assert!(matches!(check_same_with(&a, &b, options), Sameness::Same));