-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
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
Swap inconsistent assert_eq!
argument order in testing chapter
#3497
Merged
chriskrycho
merged 2 commits into
rust-lang:main
from
regexident:swap-assert-eq-arg-order
Jun 12, 2024
Merged
Swap inconsistent assert_eq!
argument order in testing chapter
#3497
chriskrycho
merged 2 commits into
rust-lang:main
from
regexident:swap-assert-eq-arg-order
Jun 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chriskrycho
approved these changes
Jun 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this seems like a reasonable change for consistency’s sake. Thanks!
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 17, 2024
Update books ## rust-lang/book 5 commits in 5228bfac8267ad24659a81b92ec5417976b5edbc..45c1a6d69edfd1fc91fb7504cb73958dbd09441e 2024-06-14 16:25:20 UTC to 2024-06-11 13:43:29 UTC - Convert Chapters 12-14 (rust-lang/book#3959) - Fix a typo in `ADMIN_TASKS` (rust-lang/book#3958) - Swap inconsistent `assert_eq!` argument order in testing chapter (rust-lang/book#3497) - Convert chapter 11 to use Listing component (rust-lang/book#3955) - Convert ch02 and ch03 listings to `<Listing>` (rust-lang/book#3926) ## rust-lang/edition-guide 5 commits in bbaabbe088e21a81a0d9ae6757705020d5d7b416..cb58c430b4e8054c2cb81d2d4434092c482a93d8 2024-06-13 16:52:10 UTC to 2024-06-06 21:19:03 UTC - Merge PR rust-lang#307: Add IntoIterator for Box<[T]> in 2024 - "cargo fix" now removes "extern crate" statements (rust-lang/edition-guide#305) - typo (rust-lang/edition-guide#306) - Remove public/private dependencies from 2024 (rust-lang/edition-guide#303) - Add stub for macro fragment matcher updates (rust-lang/edition-guide#302) ## rust-lang/reference 1 commits in 6019b76f5b28938565b251bbba0bf5cc5c43d863..0b805c65804019b0ac8f2fe3117afad82a6069b8 2024-06-07 16:06:44 UTC to 2024-06-07 16:06:44 UTC - union syntax fix for empty field list (rust-lang/reference#1509) ## rust-lang/rust-by-example 4 commits in 4840dca06cadf48b305d3ce0aeafde7f80933f80..b1d97bd6113aba732b2091ce093c76f2d05bb8a0 2024-06-17 12:45:15 UTC to 2024-06-06 11:44:38 UTC - Update ja.po and mdbook-i18n-helpers (rust-lang/rust-by-example#1863) - Fix typo (rust-lang/rust-by-example#1861) - Update instruction to add language entry of TRANSLATING.md (rust-lang/rust-by-example#1860) - Incorrect variable name according to comments (rust-lang/rust-by-example#1858) ## rust-lang/rustc-dev-guide 10 commits in 6a7374b..aec8216 2024-06-16 06:39:57 UTC to 2024-06-04 05:31:05 UTC - tell about `STAGE0_MISSING_TARGETS` for new targets (rust-lang/rustc-dev-guide#1996) - Rewrite CI documentation (rust-lang/rustc-dev-guide#1972) - Compiletest docs for recently-added features (rust-lang/rustc-dev-guide#1994) - Add {{target}} to header substitutions (rust-lang/rustc-dev-guide#1995) - run-make: add tip about quick-compile with stage0 rustc (rust-lang/rustc-dev-guide#1993) - Mention `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` in `needs-llvm-components` documentation (rust-lang/rustc-dev-guide#1990) - Add run-make port initiative to the Recurring work section (rust-lang/rustc-dev-guide#1992) - Document the `//@ unused-revision-names:` test header (rust-lang/rustc-dev-guide#1991) - Fix dead links (rust-lang/rustc-dev-guide#1988) - use `&` to load completions for PowerShell (rust-lang/rustc-dev-guide#1978)
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 17, 2024
Rollup merge of rust-lang#126603 - rustbot:docs-update, r=ehuss Update books ## rust-lang/book 5 commits in 5228bfac8267ad24659a81b92ec5417976b5edbc..45c1a6d69edfd1fc91fb7504cb73958dbd09441e 2024-06-14 16:25:20 UTC to 2024-06-11 13:43:29 UTC - Convert Chapters 12-14 (rust-lang/book#3959) - Fix a typo in `ADMIN_TASKS` (rust-lang/book#3958) - Swap inconsistent `assert_eq!` argument order in testing chapter (rust-lang/book#3497) - Convert chapter 11 to use Listing component (rust-lang/book#3955) - Convert ch02 and ch03 listings to `<Listing>` (rust-lang/book#3926) ## rust-lang/edition-guide 5 commits in bbaabbe088e21a81a0d9ae6757705020d5d7b416..cb58c430b4e8054c2cb81d2d4434092c482a93d8 2024-06-13 16:52:10 UTC to 2024-06-06 21:19:03 UTC - Merge PR rust-lang#307: Add IntoIterator for Box<[T]> in 2024 - "cargo fix" now removes "extern crate" statements (rust-lang/edition-guide#305) - typo (rust-lang/edition-guide#306) - Remove public/private dependencies from 2024 (rust-lang/edition-guide#303) - Add stub for macro fragment matcher updates (rust-lang/edition-guide#302) ## rust-lang/reference 1 commits in 6019b76f5b28938565b251bbba0bf5cc5c43d863..0b805c65804019b0ac8f2fe3117afad82a6069b8 2024-06-07 16:06:44 UTC to 2024-06-07 16:06:44 UTC - union syntax fix for empty field list (rust-lang/reference#1509) ## rust-lang/rust-by-example 4 commits in 4840dca06cadf48b305d3ce0aeafde7f80933f80..b1d97bd6113aba732b2091ce093c76f2d05bb8a0 2024-06-17 12:45:15 UTC to 2024-06-06 11:44:38 UTC - Update ja.po and mdbook-i18n-helpers (rust-lang/rust-by-example#1863) - Fix typo (rust-lang/rust-by-example#1861) - Update instruction to add language entry of TRANSLATING.md (rust-lang/rust-by-example#1860) - Incorrect variable name according to comments (rust-lang/rust-by-example#1858) ## rust-lang/rustc-dev-guide 10 commits in 6a7374b..aec8216 2024-06-16 06:39:57 UTC to 2024-06-04 05:31:05 UTC - tell about `STAGE0_MISSING_TARGETS` for new targets (rust-lang/rustc-dev-guide#1996) - Rewrite CI documentation (rust-lang/rustc-dev-guide#1972) - Compiletest docs for recently-added features (rust-lang/rustc-dev-guide#1994) - Add {{target}} to header substitutions (rust-lang/rustc-dev-guide#1995) - run-make: add tip about quick-compile with stage0 rustc (rust-lang/rustc-dev-guide#1993) - Mention `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` in `needs-llvm-components` documentation (rust-lang/rustc-dev-guide#1990) - Add run-make port initiative to the Recurring work section (rust-lang/rustc-dev-guide#1992) - Document the `//@ unused-revision-names:` test header (rust-lang/rustc-dev-guide#1991) - Fix dead links (rust-lang/rustc-dev-guide#1988) - use `&` to load completions for PowerShell (rust-lang/rustc-dev-guide#1978)
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jun 18, 2024
Update books ## rust-lang/book 5 commits in 5228bfac8267ad24659a81b92ec5417976b5edbc..45c1a6d69edfd1fc91fb7504cb73958dbd09441e 2024-06-14 16:25:20 UTC to 2024-06-11 13:43:29 UTC - Convert Chapters 12-14 (rust-lang/book#3959) - Fix a typo in `ADMIN_TASKS` (rust-lang/book#3958) - Swap inconsistent `assert_eq!` argument order in testing chapter (rust-lang/book#3497) - Convert chapter 11 to use Listing component (rust-lang/book#3955) - Convert ch02 and ch03 listings to `<Listing>` (rust-lang/book#3926) ## rust-lang/edition-guide 5 commits in bbaabbe088e21a81a0d9ae6757705020d5d7b416..cb58c430b4e8054c2cb81d2d4434092c482a93d8 2024-06-13 16:52:10 UTC to 2024-06-06 21:19:03 UTC - Merge PR #307: Add IntoIterator for Box<[T]> in 2024 - "cargo fix" now removes "extern crate" statements (rust-lang/edition-guide#305) - typo (rust-lang/edition-guide#306) - Remove public/private dependencies from 2024 (rust-lang/edition-guide#303) - Add stub for macro fragment matcher updates (rust-lang/edition-guide#302) ## rust-lang/reference 1 commits in 6019b76f5b28938565b251bbba0bf5cc5c43d863..0b805c65804019b0ac8f2fe3117afad82a6069b8 2024-06-07 16:06:44 UTC to 2024-06-07 16:06:44 UTC - union syntax fix for empty field list (rust-lang/reference#1509) ## rust-lang/rust-by-example 4 commits in 4840dca06cadf48b305d3ce0aeafde7f80933f80..b1d97bd6113aba732b2091ce093c76f2d05bb8a0 2024-06-17 12:45:15 UTC to 2024-06-06 11:44:38 UTC - Update ja.po and mdbook-i18n-helpers (rust-lang/rust-by-example#1863) - Fix typo (rust-lang/rust-by-example#1861) - Update instruction to add language entry of TRANSLATING.md (rust-lang/rust-by-example#1860) - Incorrect variable name according to comments (rust-lang/rust-by-example#1858) ## rust-lang/rustc-dev-guide 10 commits in 6a7374bd87cbac0f8be4fd4877d8186d9c313985..aec82168dd3121289a194b381f56076fc789a4d2 2024-06-16 06:39:57 UTC to 2024-06-04 05:31:05 UTC - tell about `STAGE0_MISSING_TARGETS` for new targets (rust-lang/rustc-dev-guide#1996) - Rewrite CI documentation (rust-lang/rustc-dev-guide#1972) - Compiletest docs for recently-added features (rust-lang/rustc-dev-guide#1994) - Add {{target}} to header substitutions (rust-lang/rustc-dev-guide#1995) - run-make: add tip about quick-compile with stage0 rustc (rust-lang/rustc-dev-guide#1993) - Mention `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` in `needs-llvm-components` documentation (rust-lang/rustc-dev-guide#1990) - Add run-make port initiative to the Recurring work section (rust-lang/rustc-dev-guide#1992) - Document the `//@ unused-revision-names:` test header (rust-lang/rustc-dev-guide#1991) - Fix dead links (rust-lang/rustc-dev-guide#1988) - use `&` to load completions for PowerShell (rust-lang/rustc-dev-guide#1978)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The chapter starts off by using
assert_eq!(…);
withassert_eq!(actual, expected);
argument ordering, but then suddenly swaps the order toassert_eq!(expected, actual);
withassert_eq!(4, add_two(2));
Further more it then states …
… which seems weird as in the chapter
assert_eq!(4, add_two(2))
actually is the odd one out, notassert_eq!(add_two(2), 4)
.By swapping the args the message of "which would result in the same failure message" remains true, but the text feels a bit more consistent and predictable.