You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Message on failing a test with common::test_body(left, right)fn look like this:
---- proc_macro::different_fn_types::test_str stdout ----
thread '...' panicked at 'assertion failed: `(left == right)` left: `"Hi!"`, right: `"Hello!"`', tests/file...
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
which corrosponds to
common::test_body("Hello!","Hi!").await;
The lhs/rhs mismatch between compiler's message and the function params is due to the underlying assert_eq! swap of expected and received args
pubasyncfntest_body(resp:ServiceResponse,expected_body:&str){
│ let body = test::read_body(resp).await;
│ assert_eq!(expected_body, String::from_utf8(body.to_vec()).unwrap());}
Swapping lhs and rhs
pubasyncfntest_body(resp:ServiceResponse,expected_body:&str){
│ let body = test::read_body(resp).await;
│ assert_eq!(String::from_utf8(body.to_vec()).unwrap(), expected_body);}
fixes this issue.
This follows The Rust Book convention of
assert_eq!(actual, expected);
I have a PR ready to go if this feels like a worthwhile issue and doesn't violate library wide chosen convention.
The text was updated successfully, but these errors were encountered:
Message on failing a test with
common::test_body(left, right)
fn
look like this:which corrosponds to
The lhs/rhs mismatch between compiler's message and the function params is due to the underlying
assert_eq!
swap ofexpected
andreceived
argsSwapping
lhs
andrhs
fixes this issue.
This follows The Rust Book convention of
I have a PR ready to go if this feels like a worthwhile issue and doesn't violate library wide chosen convention.
The text was updated successfully, but these errors were encountered: