Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can do this in Rust. Just put a namespace tagged as I think #[cfg(test)] or the like and they can live in the same file but won't be compiled into the non-test binary.


Technically you don't even have to `cfg`-gate it, it's just good practice to avoid e.g. unused code warnings in the test module.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: