From 2d06a05a5a600cc9cb192805888ae5a388aeef75 Mon Sep 17 00:00:00 2001 From: funkill2 Date: Thu, 13 Jun 2024 04:00:16 +0300 Subject: [PATCH] update original --- .../no-listing-04-bug-in-add-two/output.txt | 5 +- .../no-listing-04-bug-in-add-two/src/lib.rs | 2 +- rustbook-en/src/ch11-01-writing-tests.md | 48 ++++++++----------- rustbook-en/src/ch11-02-running-tests.md | 10 ++-- rustbook-en/src/ch11-03-test-organization.md | 9 ++-- 5 files changed, 32 insertions(+), 42 deletions(-) diff --git a/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt b/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt index 5e91c58b4..01b58572b 100644 --- a/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt +++ b/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt @@ -9,10 +9,9 @@ test tests::it_adds_two ... FAILED failures: ---- tests::it_adds_two stdout ---- -thread 'tests::it_adds_two' panicked at src/lib.rs:11:9: assertion `left == right` failed - left: 4 - right: 5 + left: 5 + right: 4 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs b/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs index f18662526..d7b4e139b 100644 --- a/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs +++ b/rustbook-en/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/src/lib.rs @@ -10,6 +10,6 @@ mod tests { #[test] fn it_adds_two() { - assert_eq!(4, add_two(2)); + assert_eq!(add_two(2), 4); } } diff --git a/rustbook-en/src/ch11-01-writing-tests.md b/rustbook-en/src/ch11-01-writing-tests.md index f1295931f..03bf244c6 100644 --- a/rustbook-en/src/ch11-01-writing-tests.md +++ b/rustbook-en/src/ch11-01-writing-tests.md @@ -43,7 +43,7 @@ $ cd adder The contents of the *src/lib.rs* file in your `adder` library should look like Listing 11-1. -Filename: src/lib.rs +