-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add to Testing docs to make more clear #29089
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
Conversation
When going through the docs, it is not clear that binary files cannot be tested. Additionally, it is hard to find the proper structure of a Rust crate and it took me several hours of looking through the docs to find the crates and modules section. I think we can link to it from here and it will be beneficial to those who are coming to the language.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -504,3 +504,5 @@ you add more examples. | |||
|
|||
We haven’t covered all of the details with writing documentation tests. For more, | |||
please see the [Documentation chapter](documentation.html) | |||
|
|||
One final note: Tests *cannot* be run on the binary (main) file. To see more on file arrangement see the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) Section |
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.
A few things:
- Can you make the link relative, please. See the line right about your diff.
- Section should be lower case, at the end of the sentence.
- End with a period please!
- I mean, you can run tests on a binary, you can't urn unit tests defined in the binary. You can test binaries through integration tests. So I'm not sure about this wording.
- I would prefer to just remove the
main
bit, and make it "a binary" rather than "the binary (main) file"
Some nits! I do think this is a good improvement 👍 |
@steveklabnik thanks for the feedback. I will definitely change 1-3. I was having trouble running tests from a I think the part that I am not clear on is "You can test binaries through integration tests". Would this be by using an crate rather than the built in test framework? |
Well, the
No, you'd use |
Fixed some typos and changed the link to the link to crates-and-modules to be dynamic.
@steveklabnik Thank you for clarifying that. I have made those changes that you recommended. |
@bors: r+ rollup |
📌 Commit cf926f1 has been approved by |
Thanks so much! |
When going through the docs, it is not clear that binary files cannot be tested. Additionally, it is hard to find the proper structure of a Rust crate and it took me several hours of looking through the docs to find the crates and modules section. I think we can link to it from here and it will be beneficial to those who are coming to the language.
When going through the docs, it is not clear that binary files cannot be tested. Additionally, it is hard to find the proper structure of a Rust crate and it took me several hours of looking through the docs to find the crates and modules section. I think we can link to it from here and it will be beneficial to those who are coming to the language.