rust-lang / book

The Rust Programming Language

Home Page:https://doc.rust-lang.org/book/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in statement about test output Ch 11.2

actuallyatiger opened this issue · comments

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • 11.02
    • 11.2
    • 11
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    • src/ch11-02-running-tests.md

URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch11-02-running-tests.html#showing-function-output

Description of the problem:
Issue with the statement in Showing Function Output in the first sentence, says that standard output is not captured for successful tests, but contradicts this several times later in the section.

Suggested fix:
Replace with if a test passes, Rust’s test library won't capture anything printed to standard output

but contradicts this several times later in the section.

Can you point to one of the several places that contradict this statement?

Also note by "capture", it means "will not print to your screen"

but contradicts this several times later in the section.

Can you point to one of the several places that contradict this statement?

Just before the rerun with --show-output, it says If we want to see printed values for passing tests as well... Also in the paragraph before it highlights that the output from the passing test was not shown.

... yes, the text explains that --show-output changes the default behavior of capturing? The text is correct as-is, I'm not sure where the confusion is exactly.