Closed
Description
The bug reported in #12383 made me aware of the convention that tests in non-std libraries often reside in the same file as the code under test. The privacy issue seen in that bug appears to be an immediate consequence of this convention. The convention also leads to pretty large source files that are imho difficult to handle.
Thus I would like to discuss whether this convention should be changed. To suggest a concrete alternative:
- Separate the tests into logically coherent units that focus on testing a certain functionality, each of which resides in a separate file
- Put all these test files into a dedicated test module that is flagged with one #[cfg(test)] in
lib.rs
; the test module may have substructure depending on the complexity of the library being tested
Metadata
Metadata
Assignees
Labels
No labels