Open elidupree opened 4 years ago
For example, #[live_prop_test(postcondition = "a == b")] should print out at least as much information as assert_eq!(a, b).
#[live_prop_test(postcondition = "a == b")]
assert_eq!(a, b)
The expression a == b could be implicitly replaced by something like
a == b
{ let __live_prop_test_left = a; let __live_prop_test_right = b; match __live_prop_test_left == __live_prop_test_right { true => Ok(()) false => Err(format!("\n left: {:?}\n right: {:?}", __live_prop_test_left, __live_prop_test_right)) } }
The format expression there actually has to be a clever trick so it can have a fallback when the types do not implement Debug.
I'm thinking this should apply to inequality operators as well. Can this be generalized even further? I'm not sure.
For example,
#[live_prop_test(postcondition = "a == b")]
should print out at least as much information asassert_eq!(a, b)
.The expression
a == b
could be implicitly replaced by something likeThe format expression there actually has to be a clever trick so it can have a fallback when the types do not implement Debug.
I'm thinking this should apply to inequality operators as well. Can this be generalized even further? I'm not sure.