book icon indicating copy to clipboard operation
book copied to clipboard

Refer to `--exact` for running the exact one test

Open ledusledus opened this issue 2 years ago • 1 comments
trafficstars

The section on how to run a single test is not precise for cases where test names are substrings of other tests which generates questions like https://stackoverflow.com/questions/54585804/how-to-run-a-specific-unit-test-in-rust.

I propose to point to --exact argument for this case.

ledusledus avatar Jul 19 '23 20:07 ledusledus

Thanks for opening this! We will talk about the best way to proceed here: it is possible we should add this kind of extra explanatory text, but there are also a lot of other details about how to handle things with cargo test which we do not include. In general, people should not expect the book to cover everything (it would be literally 10× the length if it did!) but rather to provide good foundations so that people can successfully discover and learn there rest on their own, e.g. by running cargo help test. (The reason I am not just closing this is because --exact in particular is pretty difficult to find! So I do think we will talk about it, but I think we will probably still end up closing it.)

chriskrycho avatar Mar 28 '24 20:03 chriskrycho