Question for all the @rustlang hackers out there -- Do you prefer #[cfg(test)] stuff in your crate, or code in the tests/*.rs files for testing the majority of your code when your library is almost entirely public API?
13
2
1
15
For modules where the interface is important, I’d rather keep the test code in separate files. For simple utility functions it doesn’t matter.
1
6
Replying to @marshray @rustlang
Yeah, for non-public content, unit tests makes perfect sense; but given 99% of the library is public API, I wonder if it ought to be in tests/*.rs

Jan 20, 2020 Β· 10:29 PM UTC

1
1
IMHO, the larger the software project, the more other considerations become secondary to the need for clean revision control on the interfaces.
1