We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be really cool if we could configure the assertion to ignore tiny differences in float values, e.g.
let assert_config = assert_json_diff::Config::new(assert_json_diff::CompareMode::Strict) .numeric_mode(assert_json_diff::NumericMode::AssumeFloat) .float_eq_epsilon(0.001); assert_json_diff::assert_json_matches!( serde_json::json!({"a": 1.1000001}), serde_json::json!({"a": 1.1000002}), assert_config );
This should work, but right now will fail with
json atoms at path ".a" are not equal: lhs: 1.1000001 rhs: 1.1000002
It would also more elegantly solve the discussion over at #17.
The text was updated successfully, but these errors were encountered:
I like it!
Sorry, something went wrong.
No branches or pull requests
It would be really cool if we could configure the assertion to ignore tiny differences in float values, e.g.
This should work, but right now will fail with
It would also more elegantly solve the discussion over at #17.
The text was updated successfully, but these errors were encountered: