Hacker News new | ask | show | jobs
by erickt 3399 days ago
One approach for this that I haven't really seen get used much that you can use a macro to get around this. In your comboluator.rs, just add this at the bottom of the file:

    #[cfg(test)]
    Mod tests {
        include!("comboluator_tests.rs");
    }
Then write your tests there. It allows you to write unit tests against private things, but also allows you to decouple the files to keep things cleaner.