Some people do
#[cfg(test)]
mod tests {
//all tests here
}
While simply putting every test in the end of the file like
#[test]
fn test1() {
}
#[test]
fn test2() {
}
works too and I can even run single tests by cargo.
What is the difference? Why do some people do it the first way?