Closed
Description
On this code:
#[cfg(test)]
mod tests {
pub fn test_addition() {
assert_eq!(2+2, 4);
}
}
I currently get
function is never used: `test_addition`, #[warn(dead_code)] on by default
What I need here is a #[test]
before the function of course. Perhaps rustc could suggest this if some of the following hints are seen
- it's in
#[cfg(test)]
- it's in a submodule
tests
- the function's called
test_*
I don't know if making suggestions based on names is considered unhygienic, but this would remove a small speed bump for new users.