-
Notifications
You must be signed in to change notification settings - Fork 13.3k
The "testing" section of the rust book needs a small correction #24030
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
Comments
nice catch! |
Should this instance be Judging from crates.io, it looks like Incoming PR to that effect. |
Oh, really now? |
I actually vote for everything else to be |
Aw, shoot. From some more grepping, the style guide and the language reference both refer to |
Ok but... to me it doesn't make sense that we use |
/me considers giving Steve a choose-your-own-adventure pair of pull requests. |
Fixes rust-lang#24030 Of the four code samples with modules in TRPL: - 2 use `mod test` - 2 use `mod tests` We should be consistent here, but which is right? The stdlib is split: $ grep -r 'mod tests {' src/lib* | wc -l 63 $ grep -r 'mod test {' src/lib* | wc -l 58 Subjectively, I like the plural. Maybe you, dear reviewer, do too?
Fixes rust-lang#24030 Of the four code samples with modules in TRPL: - 2 use `mod test` - 2 use `mod tests` We should be consistent here, but which is right? The stdlib is split: $ grep -r 'mod tests {' src/lib* | wc -l 63 $ grep -r 'mod test {' src/lib* | wc -l 58 Subjectively, I like the plural, but both the language reference and the style guide recommend the singular. So we'll go with that here, for now.
Fixes rust-lang#24030 Of the four code samples with modules in TRPL: - 2 use `mod test` - 2 use `mod tests` We should be consistent here, but which is right? The stdlib is split: $ grep -r 'mod tests {' src/lib* | wc -l 63 $ grep -r 'mod test {' src/lib* | wc -l 58 Subjectively, I like the plural, but both the language reference and the style guide recommend the singular. So we'll go with that here, for now. r? @steveklabnik
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest (see #23870, #24030 and http://users.rust-lang.org/t/guidelines-naming-of-unit-test-module/1078 for previous discussions). r? @alexcrichton
The code example at https://doc.rust-lang.org/book/testing.html#documentation-tests should be corrected changing
mod tests {
intomod test {
.The text was updated successfully, but these errors were encountered: