I use doc tests whenever reasonable for a number of reasons (locality, serves as an example, etc). I would like to use doc tests for functions and methods that are not marked pub
. I figure this would probably involve using #[cfg(test)]
in appropriate places, but I'm not sure.
How would you mark functions and methods so that they can be used in doc tests?