Put all #[test] in a mod tests (#2728)

workspace: put all `#[test]` in a `mod tests`
This commit is contained in:
Firestar99
2025-06-18 11:46:01 +02:00
committed by Keavon Chambers
parent 579bedd9ff
commit 006209c5d0
12 changed files with 748 additions and 696 deletions

View File

@@ -239,11 +239,15 @@ impl<'a> Iterator for SplitWordsIncludingSpaces<'a> {
}
}
#[test]
fn split_words_including_spaces() {
let mut split_words = SplitWordsIncludingSpaces::new("hello world .");
assert_eq!(split_words.next(), Some("hello "));
assert_eq!(split_words.next(), Some("world "));
assert_eq!(split_words.next(), Some("."));
assert_eq!(split_words.next(), None);
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn split_words_including_spaces() {
let mut split_words = SplitWordsIncludingSpaces::new("hello world .");
assert_eq!(split_words.next(), Some("hello "));
assert_eq!(split_words.next(), Some("world "));
assert_eq!(split_words.next(), Some("."));
assert_eq!(split_words.next(), None);
}
}