Skip to content

Commit

Permalink
Merge pull request #4058 from damoasda/ch11-02-fix
Browse files Browse the repository at this point in the history
Swap assert_eq! parameters
  • Loading branch information
chriskrycho authored Oct 7, 2024
2 parents 33cc45c + 2017a78 commit f38ce8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ failures:
I got the value 8
thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9:
assertion `left == right` failed
left: 5
right: 10
left: 10
right: 5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ mod tests {
#[test]
fn this_test_will_pass() {
let value = prints_and_returns_10(4);
assert_eq!(10, value);
assert_eq!(value, 10);
}

#[test]
fn this_test_will_fail() {
let value = prints_and_returns_10(8);
assert_eq!(5, value);
assert_eq!(value, 5);
}
}

0 comments on commit f38ce8b

Please sign in to comment.